diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-04 05:36:23 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-04 05:36:23 +0200 |
commit | 2c832199b2e20db5f98161b7bb6b06d94c74268f (patch) | |
tree | 07f676ba15ff696fd39829571e2e7b4b2dc153e3 /src | |
parent | c1253703aecdd9ad7f0fc23c4b2eb4366f96eac9 (diff) | |
download | exchange-2c832199b2e20db5f98161b7bb6b06d94c74268f.tar.xz |
check WTID matches
Diffstat (limited to 'src')
-rw-r--r-- | src/exchange-lib/test_exchange_api.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/exchange-lib/test_exchange_api.c b/src/exchange-lib/test_exchange_api.c index 0a82bac1a..6a49b4adf 100644 --- a/src/exchange-lib/test_exchange_api.c +++ b/src/exchange-lib/test_exchange_api.c @@ -545,6 +545,11 @@ struct Command const char *deposit_ref; /** + * Which #OC_CHECK_BANK_DEPOSIT wtid should this match? NULL for none. + */ + const char *bank_transfer_ref; + + /** * What is the expected total amount? Only used if * @e expected_response_code was #MHD_HTTP_OK. */ @@ -1457,6 +1462,22 @@ deposit_wtid_cb (void *cls, { case MHD_HTTP_OK: cmd->details.deposit_wtid.wtid = *wtid; + if (NULL != cmd->details.deposit_wtid.bank_transfer_ref) + { + const struct Command *ref; + + ref = find_command (is, + cmd->details.deposit_wtid.bank_transfer_ref); + GNUNET_assert (NULL != ref); + if (0 != memcmp (wtid, + &ref->details.check_bank_deposit.wtid, + sizeof (struct TALER_WireTransferIdentifierRawP))) + { + GNUNET_break (0); + fail (is); + return; + } + } break; default: break; @@ -2656,7 +2677,8 @@ run (void *cls) { .oc = OC_DEPOSIT_WTID, .label = "deposit-wtid-ok", .expected_response_code = MHD_HTTP_OK, - .details.deposit_wtid.deposit_ref = "deposit-simple" }, + .details.deposit_wtid.deposit_ref = "deposit-simple", + .details.deposit_wtid.bank_transfer_ref = "check_bank_deposit-499c" }, /* TODO: trigger aggregation logic and then check the |