From cdd2930a9951a552d221b8a8b8e9c0df35ad8be2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 23 May 2022 14:57:00 +0200 Subject: -misc fixes to reserve history --- src/testing/testing_api_cmd_purse_deposit.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/testing/testing_api_cmd_purse_deposit.c') diff --git a/src/testing/testing_api_cmd_purse_deposit.c b/src/testing/testing_api_cmd_purse_deposit.c index b15ba97cf..86ed1b185 100644 --- a/src/testing/testing_api_cmd_purse_deposit.c +++ b/src/testing/testing_api_cmd_purse_deposit.c @@ -72,6 +72,12 @@ struct PurseDepositState */ struct TALER_PurseContractPublicKeyP purse_pub; + /** + * The reserve we are being deposited into. + * Set as a trait once we know the reserve. + */ + struct TALER_ReservePublicKeyP reserve_pub; + /** * PurseDeposit handle while operation is running. */ @@ -151,6 +157,7 @@ deposit_cb (void *cls, { const struct TALER_TESTING_Command *purse_cmd; const struct TALER_ReserveSignatureP *reserve_sig; + const struct TALER_ReservePublicKeyP *reserve_pub; const struct GNUNET_TIME_Timestamp *merge_timestamp; purse_cmd = TALER_TESTING_interpreter_lookup_command (ds->is, @@ -164,6 +171,15 @@ deposit_cb (void *cls, TALER_TESTING_interpreter_fail (ds->is); return; } + if (GNUNET_OK != + TALER_TESTING_get_trait_reserve_pub (purse_cmd, + &reserve_pub)) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (ds->is); + return; + } + ds->reserve_pub = *reserve_pub; if (GNUNET_OK != TALER_TESTING_get_trait_timestamp (purse_cmd, 0, @@ -370,6 +386,7 @@ deposit_traits (void *cls, struct TALER_TESTING_Trait traits[] = { /* history entry MUST be first due to response code logic below! */ TALER_TESTING_make_trait_reserve_history (&ds->reserve_history), + TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub), TALER_TESTING_make_trait_purse_pub (&ds->purse_pub), TALER_TESTING_trait_end () }; -- cgit v1.2.3