diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-03-31 12:37:39 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-03-31 12:37:39 +0200 |
commit | 747ae5ef094731650911838a51e49db778b18ab6 (patch) | |
tree | 967b8e61f5bd746a21de645f989d65aa323b6aa4 /src/testing/testing_api_cmd_insert_deposit.c | |
parent | eadee56dcf9d2fed8b8e94d271db31e3c3832cfa (diff) | |
download | exchange-747ae5ef094731650911838a51e49db778b18ab6.tar.xz |
privatize more signature structs, simplify code
Diffstat (limited to 'src/testing/testing_api_cmd_insert_deposit.c')
-rw-r--r-- | src/testing/testing_api_cmd_insert_deposit.c | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c index 947bf5831..33e6cdcef 100644 --- a/src/testing/testing_api_cmd_insert_deposit.c +++ b/src/testing/testing_api_cmd_insert_deposit.c @@ -79,40 +79,37 @@ struct InsertDepositState * @param[out] issue information to initialize with "valid" data */ static void -fake_issue (struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue) +fake_issue (struct TALER_EXCHANGEDB_DenominationKeyInformation *issue) { struct GNUNET_TIME_Timestamp now; memset (issue, 0, - sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP)); + sizeof (*issue)); now = GNUNET_TIME_timestamp_get (); - issue->properties.start - = GNUNET_TIME_timestamp_hton (now); - issue->properties.expire_withdraw - = GNUNET_TIME_timestamp_hton ( - GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_MINUTES)); - issue->properties.expire_deposit - = GNUNET_TIME_timestamp_hton ( - GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_HOURS)); - issue->properties.expire_legal - = GNUNET_TIME_timestamp_hton ( - GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_DAYS)); + issue->start + = now; + issue->expire_withdraw + = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_MINUTES); + issue->expire_deposit + = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_HOURS); + issue->expire_legal + = GNUNET_TIME_relative_to_timestamp (GNUNET_TIME_UNIT_DAYS); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount_nbo ("EUR:1", - &issue->properties.value)); + TALER_string_to_amount ("EUR:1", + &issue->value)); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fees.withdraw)); + TALER_string_to_amount ("EUR:0.1", + &issue->fees.withdraw)); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fees.deposit)); + TALER_string_to_amount ("EUR:0.1", + &issue->fees.deposit)); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fees.refresh)); + TALER_string_to_amount ("EUR:0.1", + &issue->fees.refresh)); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fees.refund)); + TALER_string_to_amount ("EUR:0.1", + &issue->fees.refund)); } @@ -131,7 +128,7 @@ insert_deposit_run (void *cls, struct InsertDepositState *ids = cls; struct TALER_EXCHANGEDB_Deposit deposit; struct TALER_MerchantPrivateKeyP merchant_priv; - struct TALER_EXCHANGEDB_DenominationKeyInformationP issue; + struct TALER_EXCHANGEDB_DenominationKeyInformation issue; struct TALER_DenominationPublicKey dpk; struct TALER_DenominationPrivateKey denom_priv; @@ -144,7 +141,7 @@ insert_deposit_run (void *cls, TALER_DENOMINATION_RSA, 1024)); TALER_denom_pub_hash (&dpk, - &issue.properties.denom_hash); + &issue.denom_hash); if ( (GNUNET_OK != ids->dbc->plugin->start (ids->dbc->plugin->cls, |