diff options
Diffstat (limited to 'src/testing/testing_api_cmd_purse_merge.c')
-rw-r--r-- | src/testing/testing_api_cmd_purse_merge.c | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/src/testing/testing_api_cmd_purse_merge.c b/src/testing/testing_api_cmd_purse_merge.c index e40bcedcf..cf9d4f996 100644 --- a/src/testing/testing_api_cmd_purse_merge.c +++ b/src/testing/testing_api_cmd_purse_merge.c @@ -78,10 +78,10 @@ struct PurseMergeState struct TALER_PaytoHashP h_payto; /** - * Set to the KYC UUID *if* the exchange replied with + * Set to the KYC requirement row *if* the exchange replied with * a request for KYC. */ - uint64_t kyc_uuid; + uint64_t requirement_row; /** * Reserve history entry that corresponds to this operation. @@ -169,24 +169,17 @@ merge_cb (void *cls, break; case MHD_HTTP_UNAVAILABLE_FOR_LEGAL_REASONS: /* KYC required */ - ds->kyc_uuid = - dr->details.unavailable_for_legal_reasons.legitimization_uuid; + ds->requirement_row = + dr->details.unavailable_for_legal_reasons.requirement_row; break; } if (ds->expected_response_code != dr->hr.http_status) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Unexpected response code %u to command %s in %s:%u\n", - dr->hr.http_status, - ds->is->commands[ds->is->ip].label, - __FILE__, - __LINE__); - json_dumpf (dr->hr.reply, - stderr, - 0); - TALER_TESTING_interpreter_fail (ds->is); + TALER_TESTING_unexpected_status (ds->is, + dr->hr.http_status, + ds->expected_response_code); return; } TALER_TESTING_interpreter_next (ds->is); @@ -302,8 +295,21 @@ merge_run (void *cls, &ds->reserve_pub.eddsa_pub); { char *payto_uri; + const char *exchange_url; + const struct TALER_TESTING_Command *exchange_cmd; - payto_uri = TALER_reserve_make_payto (is->exchange_url, + exchange_cmd = TALER_TESTING_interpreter_get_command (is, + "exchange"); + if (NULL == exchange_cmd) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } + GNUNET_assert (GNUNET_OK == + TALER_TESTING_get_trait_exchange_url (exchange_cmd, + &exchange_url)); + payto_uri = TALER_reserve_make_payto (exchange_url, &ds->reserve_pub); TALER_payto_hash (payto_uri, &ds->h_payto); @@ -313,7 +319,9 @@ merge_run (void *cls, &ds->merge_pub.eddsa_pub); ds->merge_timestamp = GNUNET_TIME_timestamp_get (); ds->dh = TALER_EXCHANGE_account_merge ( - is->exchange, + TALER_TESTING_interpreter_get_context (is), + TALER_TESTING_get_exchange_url (is), + TALER_TESTING_get_keys (is), NULL, /* no wad */ &ds->reserve_priv, &ds->purse_pub, @@ -351,10 +359,8 @@ merge_cleanup (void *cls, if (NULL != ds->dh) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Command %u (%s) did not complete\n", - ds->is->ip, - cmd->label); + TALER_TESTING_command_incomplete (ds->is, + cmd->label); TALER_EXCHANGE_account_merge_cancel (ds->dh); ds->dh = NULL; } @@ -385,7 +391,7 @@ merge_traits (void *cls, TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub), TALER_TESTING_make_trait_timestamp (0, &ds->merge_timestamp), - TALER_TESTING_make_trait_legitimization_uuid (&ds->kyc_uuid), + TALER_TESTING_make_trait_legi_requirement_row (&ds->requirement_row), TALER_TESTING_make_trait_h_payto (&ds->h_payto), TALER_TESTING_trait_end () }; |