diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-10-28 21:06:23 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-10-28 21:06:23 +0100 |
commit | c2a40aa83924fd88b9c1ec0084f87109b01a8324 (patch) | |
tree | 18376f785528df6997502d51a6a361d4ebec29f6 /src/mint-lib | |
parent | 3fd22d4b6fdcb470dcbd11b35b20c0ddcf771939 (diff) | |
download | exchange-c2a40aa83924fd88b9c1ec0084f87109b01a8324.tar.xz |
fix #4032: move wire deadline form wire details to advisory field in /deposit request
Diffstat (limited to 'src/mint-lib')
-rw-r--r-- | src/mint-lib/mint_api_deposit.c | 8 | ||||
-rw-r--r-- | src/mint-lib/test_mint_api.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/mint-lib/mint_api_deposit.c b/src/mint-lib/mint_api_deposit.c index 3da9d0ae4..541317763 100644 --- a/src/mint-lib/mint_api_deposit.c +++ b/src/mint-lib/mint_api_deposit.c @@ -358,6 +358,8 @@ verify_signatures (const struct TALER_MINT_DenomPublicKey *dki, * * @param mint the mint handle; the mint must be ready to operate * @param amount the amount to be deposited + * @param wire_deadline date until which the merchant would like the mint to settle the balance (advisory, the mint cannot be + * forced to settle in the past or upon very short notice, but of course a well-behaved mint will limit aggregation based on the advice received) * @param wire_details the merchant’s account details, in a format supported by the mint * @param h_contract hash of the contact of the merchant with the customer (further details are never disclosed to the mint) * @param coin_pub coin’s public key @@ -376,6 +378,7 @@ verify_signatures (const struct TALER_MINT_DenomPublicKey *dki, struct TALER_MINT_DepositHandle * TALER_MINT_deposit (struct TALER_MINT_Handle *mint, const struct TALER_Amount *amount, + struct GNUNET_TIME_Absolute wire_deadline, json_t *wire_details, const struct GNUNET_HashCode *h_contract, const struct TALER_CoinSpendPublicKeyP *coin_pub, @@ -398,6 +401,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint, struct GNUNET_HashCode h_wire; struct TALER_Amount amount_without_fee; + (void) TALER_round_abs_time (&wire_deadline); if (GNUNET_YES != MAH_handle_is_ready (mint)) { @@ -444,7 +448,8 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint, " s:o, s:o," /* coin_pub, denom_pub */ " s:o, s:o," /* ub_sig, timestamp */ " s:I, s:o," /* transaction id, merchant_pub */ - " s:o, s:o}", /* refund_deadline, coin_sig */ + " s:o, s:o," /* refund_deadline, wire_deadline */ + " s:o}", /* coin_sig */ "f", TALER_json_from_amount (amount), "wire", wire_details, "H_wire", TALER_json_from_data (&h_wire, @@ -460,6 +465,7 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint, "merchant_pub", TALER_json_from_data (merchant_pub, sizeof (*merchant_pub)), "refund_deadline", TALER_json_from_abs (refund_deadline), + "edate", TALER_json_from_abs (wire_deadline), "coin_sig", TALER_json_from_data (coin_sig, sizeof (*coin_sig)) ); diff --git a/src/mint-lib/test_mint_api.c b/src/mint-lib/test_mint_api.c index 7b96f657c..5f465363e 100644 --- a/src/mint-lib/test_mint_api.c +++ b/src/mint-lib/test_mint_api.c @@ -1399,6 +1399,7 @@ interpreter_run (void *cls, struct TALER_CoinSpendPublicKeyP coin_pub; struct TALER_CoinSpendSignatureP coin_sig; struct GNUNET_TIME_Absolute refund_deadline; + struct GNUNET_TIME_Absolute wire_deadline; struct GNUNET_TIME_Absolute timestamp; struct TALER_MerchantPublicKeyP merchant_pub; json_t *wire; @@ -1474,6 +1475,7 @@ interpreter_run (void *cls, { refund_deadline = GNUNET_TIME_UNIT_ZERO_ABS; } + wire_deadline = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_DAYS); timestamp = GNUNET_TIME_absolute_get (); TALER_round_abs_time (×tamp); { @@ -1502,6 +1504,7 @@ interpreter_run (void *cls, cmd->details.deposit.dh = TALER_MINT_deposit (mint, &amount, + wire_deadline, wire, &h_contract, &coin_pub, |