diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-11-06 17:07:46 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-11-06 17:07:46 +0100 |
commit | 3c9a5ab6d19db8df7110a859df3f040e80d8dbe0 (patch) | |
tree | c3b3838397ca4e0e23a074dd92def0a9e1e16e24 | |
parent | ab6fd118b5cd23c414912f4fb7087f16d12f21a0 (diff) | |
download | merchant-3c9a5ab6d19db8df7110a859df3f040e80d8dbe0.tar.gz merchant-3c9a5ab6d19db8df7110a859df3f040e80d8dbe0.tar.bz2 merchant-3c9a5ab6d19db8df7110a859df3f040e80d8dbe0.zip |
fix signature in test
-rw-r--r-- | src/backenddb/test_merchantdb.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c index fc7423bd..184ee580 100644 --- a/src/backenddb/test_merchantdb.c +++ b/src/backenddb/test_merchantdb.c @@ -2430,14 +2430,11 @@ make_deposit (const struct InstanceData *instance, struct DepositData *deposit) { struct TALER_CoinSpendPrivateKeyP coin_priv; - struct TALER_DepositRequestPS deposit_sign = { - .purpose = { - .size = htonl (sizeof (struct TALER_DepositRequestPS)), - .purpose = htonl (TALER_SIGNATURE_WALLET_COIN_DEPOSIT) - } - - + struct TALER_DepositConfirmationPS deposit_sign = { + .purpose.size = htonl (sizeof (deposit_sign)), + .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_DEPOSIT) }; + struct TALER_Amount amount_without_fee; deposit->timestamp = GNUNET_TIME_absolute_get (); GNUNET_assert (GNUNET_OK == @@ -2459,17 +2456,19 @@ make_deposit (const struct InstanceData *instance, GNUNET_assert (GNUNET_OK == TALER_string_to_amount ("EUR:2.00", &deposit->wire_fee)); + GNUNET_assert (0 <= + TALER_amount_subtract (&amount_without_fee, + &deposit->amount_with_fee, + &deposit->deposit_fee)); deposit->h_wire = account->h_wire; deposit_sign.h_contract_terms = deposit->h_contract_terms; deposit_sign.h_wire = deposit->h_wire; - deposit_sign.wallet_timestamp = GNUNET_TIME_absolute_hton ( + deposit_sign.exchange_timestamp = GNUNET_TIME_absolute_hton ( GNUNET_TIME_absolute_get ()); deposit_sign.refund_deadline = GNUNET_TIME_absolute_hton ( GNUNET_TIME_absolute_get ()); - TALER_amount_hton (&deposit_sign.amount_with_fee, - &deposit->amount_with_fee); - TALER_amount_hton (&deposit_sign.deposit_fee, - &deposit->deposit_fee); + TALER_amount_hton (&deposit_sign.amount_without_fee, + &amount_without_fee); deposit_sign.merchant = instance->merchant_pub; deposit_sign.coin_pub = deposit->coin_pub; GNUNET_CRYPTO_eddsa_sign (&signkey->exchange_priv.eddsa_priv, |