From 3c9a5ab6d19db8df7110a859df3f040e80d8dbe0 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 6 Nov 2021 17:07:46 +0100 Subject: fix signature in test --- src/backenddb/test_merchantdb.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/backenddb/test_merchantdb.c') 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, -- cgit v1.2.3