diff options
Diffstat (limited to 'src/testing/testing_api_cmd_bank_admin_check.c')
-rw-r--r-- | src/testing/testing_api_cmd_bank_admin_check.c | 60 |
1 files changed, 26 insertions, 34 deletions
diff --git a/src/testing/testing_api_cmd_bank_admin_check.c b/src/testing/testing_api_cmd_bank_admin_check.c index 473f3f3f2..6406fe2c2 100644 --- a/src/testing/testing_api_cmd_bank_admin_check.c +++ b/src/testing/testing_api_cmd_bank_admin_check.c @@ -82,8 +82,30 @@ check_bank_admin_transfer_run (void *cls, const char *credit_payto; const struct TALER_ReservePublicKeyP *reserve_pub; const struct TALER_TESTING_Command *cmd_ref; + struct TALER_FAKEBANK_Handle *fakebank; (void) cmd; + { + const struct TALER_TESTING_Command *fakebank_cmd; + + fakebank_cmd + = TALER_TESTING_interpreter_get_command (is, + "fakebank"); + if (NULL == fakebank_cmd) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } + if (GNUNET_OK != + TALER_TESTING_get_trait_fakebank (fakebank_cmd, + &fakebank)) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } + } cmd_ref = TALER_TESTING_interpreter_lookup_command (is, bcs->reserve_pub_ref); @@ -95,7 +117,6 @@ check_bank_admin_transfer_run (void *cls, } if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (cmd_ref, - 0, &reserve_pub)) { GNUNET_break (0); @@ -103,7 +124,6 @@ check_bank_admin_transfer_run (void *cls, TALER_TESTING_interpreter_fail (is); return; } - TALER_LOG_INFO ("Deposit reference NOT given\n"); debit_payto = bcs->debit_payto; credit_payto = bcs->credit_payto; if (GNUNET_OK != @@ -111,9 +131,9 @@ check_bank_admin_transfer_run (void *cls, &amount)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Failed to parse amount `%s' at %u\n", + "Failed to parse amount `%s' at %s\n", bcs->amount, - is->ip); + TALER_TESTING_interpreter_get_current_label (is)); TALER_TESTING_interpreter_fail (is); return; } @@ -124,7 +144,7 @@ check_bank_admin_transfer_run (void *cls, debit_payto, debit_account); if (GNUNET_OK != - TALER_FAKEBANK_check_credit (is->fakebank, + TALER_FAKEBANK_check_credit (fakebank, &amount, debit_account, credit_account, @@ -160,33 +180,6 @@ check_bank_admin_transfer_cleanup (void *cls, /** - * Offer internal data from a "bank admin check" CMD state. - * - * @param cls closure. - * @param[out] ret result. - * @param trait name of the trait. - * @param index index number of the object to offer. - * @return #GNUNET_OK on success. - */ -static int -check_bank_admin_transfer_traits (void *cls, - const void **ret, - const char *trait, - unsigned int index) -{ - struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_trait_end () - }; - - (void) cls; - return TALER_TESTING_get_trait (traits, - ret, - trait, - index); -} - - -/** * Make a "bank check" CMD. It checks whether a particular wire transfer to * the exchange (credit) has been made or not. * @@ -217,8 +210,7 @@ TALER_TESTING_cmd_check_bank_admin_transfer .label = label, .cls = bcs, .run = &check_bank_admin_transfer_run, - .cleanup = &check_bank_admin_transfer_cleanup, - .traits = &check_bank_admin_transfer_traits + .cleanup = &check_bank_admin_transfer_cleanup }; return cmd; |