gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-merchant] 17/24: fix signature in test


From: gnunet
Subject: [taler-merchant] 17/24: fix signature in test
Date: Wed, 17 Nov 2021 12:44:40 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository merchant.

commit 3c9a5ab6d19db8df7110a859df3f040e80d8dbe0
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Nov 6 17:07:46 2021 +0100

    fix signature in test
---
 src/backenddb/test_merchantdb.c | 23 +++++++++++------------
 1 file 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,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]