test command "fakebank transfer"

takes exchange url in arguments
This commit is contained in:
Marcello Stanisci 2018-02-21 09:56:49 +01:00
parent 6ac3c6cd4d
commit b09bd97c3b
No known key found for this signature in database
GPG Key ID: 8D526861953F4C0F
3 changed files with 22 additions and 9 deletions

View File

@ -103,7 +103,7 @@ static char *fakebank_url;
#define CMD_TRANSFER_TO_EXCHANGE(label,amount) \ #define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
TALER_TESTING_cmd_fakebank_transfer (label, amount, \ TALER_TESTING_cmd_fakebank_transfer (label, amount, \
fakebank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \ fakebank_url, USER_ACCOUNT_NO, EXCHANGE_ACCOUNT_NO, \
USER_LOGIN_NAME, USER_LOGIN_PASS) USER_LOGIN_NAME, USER_LOGIN_PASS, "https://exchange.com/")
/** /**
* Run wire transfer of funds from some user's account to the * Run wire transfer of funds from some user's account to the
@ -116,7 +116,7 @@ static char *fakebank_url;
TALER_TESTING_cmd_fakebank_transfer_with_subject \ TALER_TESTING_cmd_fakebank_transfer_with_subject \
(label, amount, fakebank_url, USER_ACCOUNT_NO, \ (label, amount, fakebank_url, USER_ACCOUNT_NO, \
EXCHANGE_ACCOUNT_NO, USER_LOGIN_NAME, USER_LOGIN_PASS, \ EXCHANGE_ACCOUNT_NO, USER_LOGIN_NAME, USER_LOGIN_PASS, \
subject) subject, "https://exchange.com/")
/** /**
* Main function that will tell the interpreter what commands to * Main function that will tell the interpreter what commands to

View File

@ -103,6 +103,10 @@ struct FakebankTransferState
*/ */
uint64_t serial_id; uint64_t serial_id;
/**
* Exchange URL.
*/
const char *exchange_url;
}; };
@ -214,7 +218,7 @@ fakebank_transfer_run (void *cls,
(TALER_TESTING_interpreter_get_context (is), (TALER_TESTING_interpreter_get_context (is),
fts->bank_url, fts->bank_url,
&auth, &auth,
"https://exchange.com/", /* exchange URL: FIXME */ fts->exchange_url,
subject, subject,
&fts->amount, &fts->amount,
fts->debit_account_no, fts->debit_account_no,
@ -303,7 +307,8 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
uint64_t debit_account_no, uint64_t debit_account_no,
uint64_t credit_account_no, uint64_t credit_account_no,
const char *auth_username, const char *auth_username,
const char *auth_password) const char *auth_password,
const char *exchange_url)
{ {
struct TALER_TESTING_Command cmd; struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -314,6 +319,7 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
fts->debit_account_no = debit_account_no; fts->debit_account_no = debit_account_no;
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))
@ -346,7 +352,8 @@ TALER_TESTING_cmd_fakebank_transfer_with_subject
uint64_t credit_account_no, uint64_t credit_account_no,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *subject) const char *subject,
const char *exchange_url)
{ {
struct TALER_TESTING_Command cmd; struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -358,6 +365,7 @@ TALER_TESTING_cmd_fakebank_transfer_with_subject
fts->auth_username = auth_username; fts->auth_username = auth_username;
fts->auth_password = auth_password; fts->auth_password = auth_password;
fts->subject = subject; fts->subject = subject;
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))
@ -390,7 +398,8 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
uint64_t credit_account_no, uint64_t credit_account_no,
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 TALER_TESTING_Command cmd; struct TALER_TESTING_Command cmd;
struct FakebankTransferState *fts; struct FakebankTransferState *fts;
@ -402,6 +411,7 @@ 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))

View File

@ -396,7 +396,8 @@ TALER_TESTING_cmd_fakebank_transfer (const char *label,
uint64_t debit_account_no, uint64_t debit_account_no,
uint64_t credit_account_no, uint64_t credit_account_no,
const char *auth_username, const char *auth_username,
const char *auth_password); const char *auth_password,
const char *exchange_url);
/** /**
@ -412,7 +413,8 @@ TALER_TESTING_cmd_fakebank_transfer_with_subject
uint64_t credit_account_no, uint64_t credit_account_no,
const char *auth_username, const char *auth_username,
const char *auth_password, const char *auth_password,
const char *subject); const char *subject,
const char *exchange_url);
/** /**
@ -428,7 +430,8 @@ TALER_TESTING_cmd_fakebank_transfer_with_ref
uint64_t credit_account_no, uint64_t credit_account_no,
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);
/** /**