summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_deposit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-06-27 18:49:12 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-05 16:50:15 +0200
commitb0311807ff8c7702a87b99da1e21a963eb280633 (patch)
treebddcdd2f049f4190ac5dfe523ac6a91fa344bdf0 /src/testing/testing_api_cmd_deposit.c
parentc88af6df724a47919fd8b0fc1d25f1273120c4e6 (diff)
downloadexchange-b0311807ff8c7702a87b99da1e21a963eb280633.tar.gz
exchange-b0311807ff8c7702a87b99da1e21a963eb280633.tar.bz2
exchange-b0311807ff8c7702a87b99da1e21a963eb280633.zip
fix FIXME by exposing deposit permission signing in API instead of doing it inside of the testing logic
Diffstat (limited to 'src/testing/testing_api_cmd_deposit.c')
-rw-r--r--src/testing/testing_api_cmd_deposit.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
index f302a218b..e7a4c2988 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -394,39 +394,26 @@ deposit_run (void *cls,
else
{
ds->refund_deadline = ds->wallet_timestamp;
- wire_deadline = GNUNET_TIME_relative_to_absolute
- (GNUNET_TIME_UNIT_ZERO);
+ wire_deadline = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_ZERO);
}
GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv,
&merchant_pub.eddsa_pub);
-
(void) GNUNET_TIME_round_abs (&wire_deadline);
-
- // FIXME: This should be part of TALER_EXCHANGE_deposit()!
{
- struct TALER_DepositRequestPS dr;
-
- memset (&dr, 0, sizeof (dr));
- dr.purpose.size = htonl
- (sizeof (struct TALER_DepositRequestPS));
- dr.purpose.purpose = htonl
- (TALER_SIGNATURE_WALLET_COIN_DEPOSIT);
- dr.h_contract_terms = h_contract_terms;
+ struct GNUNET_HashCode h_wire;
+
GNUNET_assert (GNUNET_OK ==
TALER_JSON_merchant_wire_signature_hash (ds->wire_details,
- &dr.h_wire));
- dr.wallet_timestamp = GNUNET_TIME_absolute_hton (ds->wallet_timestamp);
- dr.refund_deadline = GNUNET_TIME_absolute_hton
- (ds->refund_deadline);
- TALER_amount_hton (&dr.amount_with_fee,
- &ds->amount);
- TALER_amount_hton (&dr.deposit_fee,
- &denom_pub->fee_deposit);
- dr.merchant = merchant_pub;
- dr.coin_pub = coin_pub;
- GNUNET_CRYPTO_eddsa_sign (&coin_priv->eddsa_priv,
- &dr,
- &coin_sig.eddsa_signature);
+ &h_wire));
+ TALER_EXCHANGE_deposit_permission_sign (&ds->amount,
+ &denom_pub->fee_deposit,
+ &h_wire,
+ &h_contract_terms,
+ coin_priv,
+ ds->wallet_timestamp,
+ &merchant_pub,
+ ds->refund_deadline,
+ &coin_sig);
}
ds->dh = TALER_EXCHANGE_deposit (is->exchange,
&ds->amount,