remove exchange-url argument from /admin/add/incoming

This commit is contained in:
Christian Grothoff 2020-01-11 23:06:10 +01:00
parent 9443c10d7f
commit 2ee33e3cbc
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
4 changed files with 37 additions and 59 deletions

View File

@ -42,8 +42,19 @@
/** /**
* Fakebank URL. * Fakebank URL.
*/ */
static char *bank_url; static char *bank_url;
/**
* Account URL.
*/
static char *account_url;
/**
* payto://-URL of another account.
*/
static char *payto_url;
/** /**
* Handle to the Py-bank daemon. * Handle to the Py-bank daemon.
*/ */
@ -85,24 +96,17 @@ static void
run (void *cls, run (void *cls,
struct TALER_TESTING_Interpreter *is) struct TALER_TESTING_Interpreter *is)
{ {
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Bank serves at `%s'\n",
bank_url);
extern struct TALER_BANK_AuthenticationData AUTHS[];
struct TALER_TESTING_Command commands[] = { struct TALER_TESTING_Command commands[] = {
TALER_TESTING_cmd_bank_history ("history-0", TALER_TESTING_cmd_bank_credits ("history-0",
bank_url, account_url,
TALER_TESTING_BANK_ACCOUNT_NUMBER,
TALER_BANK_DIRECTION_BOTH,
GNUNET_YES,
NULL, NULL,
1), 1),
/* WARNING: old API has expected http response code among TALER_TESTING_cmd_fakebank_transfer ("debit-1",
* the parameters, although it was always set as '200 OK' */
TRANSFER ("debit-1",
"KUDOS:5.01", "KUDOS:5.01",
TALER_TESTING_EXCHANGE_ACCOUNT_NUMBER, account_url,
TALER_TESTING_BANK_ACCOUNT_NUMBER, payto_url,
NULL,
NULL,
"subject 1"), "subject 1"),
TALER_TESTING_cmd_bank_history ("history-1c", TALER_TESTING_cmd_bank_history ("history-1c",
bank_url, bank_url,
@ -168,6 +172,17 @@ run (void *cls,
TALER_TESTING_cmd_end () TALER_TESTING_cmd_end ()
}; };
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Bank serves at `%s'\n",
bank_url);
GNUNET_asprintf (&account_url,
"%s/%s",
base_url,
"alice");
GNUNET_asprintf (&payto_url,
"payto://x-taler-bank/%s/%s",
base_url,
"bob");
if (GNUNET_YES == WITH_FAKEBANK) if (GNUNET_YES == WITH_FAKEBANK)
TALER_TESTING_run_with_fakebank (is, TALER_TESTING_run_with_fakebank (is,
commands, commands,

View File

@ -65,8 +65,7 @@ enum BenchmarkError
x_taler_bank.account_base_url, \ x_taler_bank.account_base_url, \
exchange_payto_url, \ exchange_payto_url, \
"dummy_user", \ "dummy_user", \
"dummy_password", \ "dummy_password"))
"http://example.com/"))
/** /**

View File

@ -722,10 +722,6 @@ TALER_TESTING_setup_with_auditor_and_exchange (TALER_TESTING_Main main_cb,
* @param auth_username username identifying the @a * @param auth_username username identifying the @a
* debit_account_no at the bank. * debit_account_no at the bank.
* @param auth_password password for @a auth_username. * @param auth_password password for @a auth_username.
* @param exchange_url which exchange is involved in this transfer.
* This data is used for tracking purposes (FIXME: explain
* _how_).
*
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -734,8 +730,7 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
const char *account_base_url, const char *account_base_url,
const char *payto_credit_account, const char *payto_credit_account,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password);
const char *exchange_url);
/** /**
@ -754,9 +749,6 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
* @param auth_password password for @a auth_username. * @param auth_password password for @a auth_username.
* @param ref reference to a command that can offer a reserve * @param ref reference to a command that can offer a reserve
* private key. * private key.
* @param exchange_url the exchage involved in the transfer,
* tipically receiving the money in order to fuel a reserve.
*
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -767,8 +759,7 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref (const char *label,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *ref, const char *ref);
const char *exchange_url);
/** /**
@ -790,11 +781,7 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref (const char *label,
* instance, the configuration file will provide the private * instance, the configuration file will provide the private
* key of the tipping reserve. This data will then used to * key of the tipping reserve. This data will then used to
* construct the wire transfer subject line. * construct the wire transfer subject line.
* @param exchange_url which exchange is involved in this transfer.
* This data is used for tracking purposes (FIXME: explain
* _how_).
* @param config_filename configuration file to use. * @param config_filename configuration file to use.
*
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -806,7 +793,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_instance (const char *label,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *instance, const char *instance,
const char *exchange_url,
const char *config_filename); const char *config_filename);

View File

@ -16,10 +16,9 @@
License along with TALER; see the file COPYING. If not, see License along with TALER; see the file COPYING. If not, see
<http://www.gnu.org/licenses/> <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchange-lib/testing_api_cmd_fakebank_transfer.c * @file exchange-lib/testing_api_cmd_fakebank_transfer.c
* @brief implementation of a fakebank wire transfer command * @brief implementation of a bank /admin/add/incoming command
* @author Christian Grothoff * @author Christian Grothoff
* @author Marcello Stanisci * @author Marcello Stanisci
*/ */
@ -101,14 +100,6 @@ struct FakebankTransferState
*/ */
struct GNUNET_TIME_Absolute timestamp; struct GNUNET_TIME_Absolute timestamp;
/**
* Exchange URL. This value is fed to the bank when requesting
* the wire transfer; note: the bank needs it because a merchant
* might want to know which exchange performed a wire transfer to
* them, just by looking at bank records.
*/
const char *exchange_url;
/** /**
* Merchant instance. Sometimes used to get the tip reserve * Merchant instance. Sometimes used to get the tip reserve
* private key by reading the appropriate config section. * private key by reading the appropriate config section.
@ -416,7 +407,6 @@ fakebank_transfer_traits (void *cls,
{ {
struct FakebankTransferState *fts = cls; struct FakebankTransferState *fts = cls;
struct TALER_TESTING_Trait traits[] = { struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_url (0, fts->exchange_url),
TALER_TESTING_make_trait_url (1, fts->debit_url), TALER_TESTING_make_trait_url (1, fts->debit_url),
TALER_TESTING_MAKE_TRAIT_ROW_ID (&fts->serial_id), TALER_TESTING_MAKE_TRAIT_ROW_ID (&fts->serial_id),
TALER_TESTING_MAKE_TRAIT_CREDIT_ACCOUNT (fts->payto_credit_account), TALER_TESTING_MAKE_TRAIT_CREDIT_ACCOUNT (fts->payto_credit_account),
@ -450,7 +440,6 @@ fakebank_transfer_traits (void *cls,
* @param auth_username username identifying the @a * @param auth_username username identifying the @a
* debit_account_no at the bank. * debit_account_no at the bank.
* @param auth_password password for @a auth_username. * @param auth_password password for @a auth_username.
* @param exchange_url which exchange is involved in this transfer.
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -460,8 +449,7 @@ TALER_TESTING_cmd_fakebank_transfer
const char *account_base_url, const char *account_base_url,
const char *payto_credit_account, const char *payto_credit_account,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password)
const char *exchange_url)
{ {
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -470,7 +458,6 @@ TALER_TESTING_cmd_fakebank_transfer
fts->payto_credit_account = payto_credit_account; fts->payto_credit_account = payto_credit_account;
fts->auth_username = auth_username; fts->auth_username = auth_username;
fts->auth_password = auth_password; fts->auth_password = auth_password;
fts->exchange_url = exchange_url;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_string_to_amount (amount, TALER_string_to_amount (amount,
&fts->amount)) &fts->amount))
@ -514,9 +501,6 @@ TALER_TESTING_cmd_fakebank_transfer
* @param auth_password password for @a auth_username. * @param auth_password password for @a auth_username.
* @param ref reference to a command that can offer a reserve * @param ref reference to a command that can offer a reserve
* private key. * private key.
* @param exchange_url the exchage involved in the transfer,
* tipically receiving the money in order to fuel a reserve.
*
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -527,8 +511,7 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
const char *payto_credit_account, const char *payto_credit_account,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *ref, const char *ref)
const char *exchange_url)
{ {
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -538,7 +521,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
fts->auth_username = auth_username; fts->auth_username = auth_username;
fts->auth_password = auth_password; fts->auth_password = auth_password;
fts->reserve_reference = ref; fts->reserve_reference = ref;
fts->exchange_url = exchange_url;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_string_to_amount (amount, TALER_string_to_amount (amount,
&fts->amount)) &fts->amount))
@ -587,9 +569,7 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
* instance, the configuration file will provide the private * instance, the configuration file will provide the private
* key of the tipping reserve. This data will then used to * key of the tipping reserve. This data will then used to
* construct the wire transfer subject line. * construct the wire transfer subject line.
* @param exchange_url which exchange is involved in this transfer.
* @param config_filename configuration file to use. * @param config_filename configuration file to use.
*
* @return the command. * @return the command.
*/ */
struct TALER_TESTING_Command struct TALER_TESTING_Command
@ -601,7 +581,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_instance
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *instance, const char *instance,
const char *exchange_url,
const char *config_filename) const char *config_filename)
{ {
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -612,7 +591,6 @@ TALER_TESTING_cmd_fakebank_transfer_with_instance
fts->auth_username = auth_username; fts->auth_username = auth_username;
fts->auth_password = auth_password; fts->auth_password = auth_password;
fts->instance = instance; fts->instance = instance;
fts->exchange_url = exchange_url;
fts->config_filename = config_filename; fts->config_filename = config_filename;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_string_to_amount (amount, TALER_string_to_amount (amount,