diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-30 16:31:24 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-30 16:31:24 +0200 |
commit | 7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a (patch) | |
tree | 60e9259939dca8f9bb9ad2539d594fb15e67a170 /src/testing/testing_api_cmd_reserve_status.c | |
parent | 7f902c0fc9bc7e0832d01169e6f580ab671fbf08 (diff) | |
download | exchange-7b25787a4b8ac0a0b3cbc2174ba3cac9c564346a.tar.xz |
-generate 404 on non-existing accounts for fakebank, use payto://-URIs with receiver-name in tests
Diffstat (limited to 'src/testing/testing_api_cmd_reserve_status.c')
-rw-r--r-- | src/testing/testing_api_cmd_reserve_status.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/src/testing/testing_api_cmd_reserve_status.c b/src/testing/testing_api_cmd_reserve_status.c index 1d104cc3e..9abd99f0b 100644 --- a/src/testing/testing_api_cmd_reserve_status.c +++ b/src/testing/testing_api_cmd_reserve_status.c @@ -126,7 +126,6 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, else { const struct TALER_ReservePublicKeyP *rp; - const struct TALER_EXCHANGE_ReserveHistoryEntry *he; if (GNUNET_OK != TALER_TESTING_get_trait_reserve_pub (cmd, @@ -136,32 +135,39 @@ analyze_command (const struct TALER_ReservePublicKeyP *reserve_pub, GNUNET_memcmp (rp, reserve_pub)) return GNUNET_OK; /* command affects some _other_ reserve */ - if (GNUNET_OK != - TALER_TESTING_get_trait_reserve_history (cmd, - &he)) - { - /* NOTE: only for debugging... */ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Command `%s' has the reserve_pub trait, but does not reserve history trait\n", - cmd->label); - return GNUNET_OK; /* command does nothing for reserves */ - } - for (unsigned int i = 0; i<history_length; i++) + for (unsigned int j = 0; true; j++) { - if (found[i]) - continue; /* already found, skip */ - if (0 == - TALER_TESTING_history_entry_cmp (he, - &history[i])) + const struct TALER_EXCHANGE_ReserveHistoryEntry *he; + + if (GNUNET_OK != + TALER_TESTING_get_trait_reserve_history (cmd, + j, + &he)) { - found[i] = GNUNET_YES; - return GNUNET_OK; + /* NOTE: only for debugging... */ + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Command `%s' has the reserve_pub trait, but does not reserve history trait\n", + cmd->label); + return GNUNET_OK; /* command does nothing for reserves */ + } + for (unsigned int i = 0; i<history_length; i++) + { + if (found[i]) + continue; /* already found, skip */ + if (0 == + TALER_TESTING_history_entry_cmp (he, + &history[i])) + { + found[i] = true; + return GNUNET_OK; + } } + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Command `%s' reserve history entry #%u not found\n", + cmd->label, + j); + return GNUNET_SYSERR; } - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Command `%s' reserve history entry not found\n", - cmd->label); - return GNUNET_SYSERR; } } |