diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/test_auditor_api.conf | 13 | ||||
-rw-r--r-- | src/lib/test_exchange_api_home/.config/taler/account-2.json | 5 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_bank_admin_check.c | 4 | ||||
-rw-r--r-- | src/lib/testing_api_cmd_bank_check.c | 7 | ||||
-rw-r--r-- | src/lib/testing_api_helpers_bank.c | 65 |
5 files changed, 49 insertions, 45 deletions
diff --git a/src/lib/test_auditor_api.conf b/src/lib/test_auditor_api.conf index 8133ce481..7bb57c3a9 100644 --- a/src/lib/test_auditor_api.conf +++ b/src/lib/test_auditor_api.conf @@ -59,19 +59,24 @@ CONFIG = "postgres:///talercheck" # advertised in /wire. [account-1] # What is the URL of our account? -URL = "payto://x-taler-bank/localhost:8082/42" +URL = "payto://x-taler-bank/localhost/42" +WIRE_GATEWAY_URL = "http://localhost:8082/42/" # This is the response we give out for the /wire request. It provides # wallets with the bank information for transfers to the exchange. WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json + # Which wire plugin should we used to access the account? METHOD = x-taler-bank +[bank] +HTTP_PORT = 8082 + # ENABLE_CREDIT = YES [account-2] # What is the bank account (with the "Taler Bank" demo system)? -URL = "payto://x-taler-bank/localhost:8082/2" -FAKEBANK_PORT = 8082 +WIRE_GATEWAY_URL = "http://localhost:8082/2/" +URL = "payto://x-taler-bank/localhost/2" # This is the response we give out for the /wire request. It provides # wallets with the bank information for transfers to the exchange. @@ -81,7 +86,7 @@ WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json METHOD = x-taler-bank # Authentication information for basic authentication -TALER_BANK_AUTH_METHOD = "basic" +WIRE_GATEWAY_AUTH_METHOD = "basic" USERNAME = user PASSWORD = pass diff --git a/src/lib/test_exchange_api_home/.config/taler/account-2.json b/src/lib/test_exchange_api_home/.config/taler/account-2.json index e63710448..f39677eff 100644 --- a/src/lib/test_exchange_api_home/.config/taler/account-2.json +++ b/src/lib/test_exchange_api_home/.config/taler/account-2.json @@ -1,5 +1,4 @@ { - "url": "payto://x-taler-bank/localhost:8082/2", - "master_sig": "2MNAYBN0Q5VEJKFBGH2SRJQSV3QXA81FPXMFF5Y5YQQW1MRTDGJTZX35XHMCZFZ9SN9Q4TQ6MNM8EX7GPPD2MP8Q528A1D8RK7N9J38", - "master_pub": "98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG" + "url": "payto://x-taler-bank/localhost/2", + "master_sig": "HEWC1XDS0QZ53YQR451VRKD4N968NXWGZXS30HJ59MJ0PESACK1ZYPYCAT15P08WD58C7D7F6EVN26D59JKA75XEBDQCM8VYFETK82R" }
\ No newline at end of file diff --git a/src/lib/testing_api_cmd_bank_admin_check.c b/src/lib/testing_api_cmd_bank_admin_check.c index 4090b6e37..c63a1b4aa 100644 --- a/src/lib/testing_api_cmd_bank_admin_check.c +++ b/src/lib/testing_api_cmd_bank_admin_check.c @@ -119,6 +119,10 @@ check_bank_admin_transfer_run (void *cls, } debit_account = TALER_xtalerbank_account_from_payto (debit_payto); credit_account = TALER_xtalerbank_account_from_payto (credit_payto); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "converted debit_payto (%s) to debit_account (%s)\n", + debit_payto, + debit_account); if (GNUNET_OK != TALER_FAKEBANK_check_credit (is->fakebank, &amount, diff --git a/src/lib/testing_api_cmd_bank_check.c b/src/lib/testing_api_cmd_bank_check.c index c06477a1e..78526cdd2 100644 --- a/src/lib/testing_api_cmd_bank_check.c +++ b/src/lib/testing_api_cmd_bank_check.c @@ -149,8 +149,15 @@ check_bank_transfer_run (void *cls, &exchange_base_url)); } + debit_account = TALER_xtalerbank_account_from_payto (debit_payto); credit_account = TALER_xtalerbank_account_from_payto (credit_payto); + + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "converted debit_payto (%s) to debit_account (%s)\n", + debit_payto, + debit_account); + if (GNUNET_OK != TALER_FAKEBANK_check_debit (is->fakebank, &amount, diff --git a/src/lib/testing_api_helpers_bank.c b/src/lib/testing_api_helpers_bank.c index 342137c9c..c3dd97639 100644 --- a/src/lib/testing_api_helpers_bank.c +++ b/src/lib/testing_api_helpers_bank.c @@ -379,8 +379,7 @@ TALER_TESTING_prepare_fakebank (const char *config_filename, struct TALER_TESTING_BankConfiguration *bc) { struct GNUNET_CONFIGURATION_Handle *cfg; - char *payto_url; - uint16_t fakebank_port; + unsigned long long fakebank_port; cfg = GNUNET_CONFIGURATION_create (); if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, @@ -388,53 +387,38 @@ TALER_TESTING_prepare_fakebank (const char *config_filename, return GNUNET_SYSERR; if (GNUNET_OK != - TALER_BANK_auth_parse_cfg (cfg, - "account-" EXCHANGE_ACCOUNT_NAME, - &bc->exchange_auth)) + GNUNET_CONFIGURATION_get_value_number (cfg, + "BANK", + "HTTP_PORT", + &fakebank_port)) { - GNUNET_break (0); + GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, + "BANK", + "HTTP_PORT"); GNUNET_CONFIGURATION_destroy (cfg); return GNUNET_SYSERR; } + bc->exchange_auth.method = TALER_BANK_AUTH_NONE; + // FIXME: we should not hardcode exchange account number "2" + GNUNET_asprintf (&bc->exchange_auth.wire_gateway_url, + "http://localhost:%u/2/", + (unsigned int) fakebank_port); - GNUNET_assert (TALER_BANK_AUTH_FAKEBANK == bc->exchange_auth.method); - - fakebank_port = bc->exchange_auth.details.fakebank.fb_port; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Using fakebank %s on port %u\n", + bc->exchange_auth.wire_gateway_url, + (unsigned int) fakebank_port); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Fakebank port from config: %u\n", (unsigned int) fakebank_port); - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, - config_section, - "URL", - &payto_url)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, - config_section, - "URL"); - GNUNET_CONFIGURATION_destroy (cfg); - return GNUNET_SYSERR; - } GNUNET_CONFIGURATION_destroy (cfg); - bc->bank_url - = TALER_xtalerbank_base_url_from_payto (payto_url); - if (NULL == bc->bank_url) - { - GNUNET_log_config_invalid - (GNUNET_ERROR_TYPE_WARNING, - config_section, - "URL", - "expected `x-taler-bank' payto://-URL"); - GNUNET_free (payto_url); - return GNUNET_SYSERR; - } + bc->bank_url = bc->exchange_auth.wire_gateway_url; if (GNUNET_OK != TALER_TESTING_url_port_free (bc->bank_url)) { GNUNET_free (bc->bank_url); bc->bank_url = NULL; - GNUNET_free (payto_url); return GNUNET_SYSERR; } GNUNET_asprintf (&bc->exchange_account_url, @@ -444,13 +428,18 @@ TALER_TESTING_prepare_fakebank (const char *config_filename, GNUNET_assert (NULL != bc->exchange_account_url); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "fakebank account URL: %s\n", bc->exchange_account_url); - GNUNET_free (payto_url); /* Now we know it's the fake bank, for purpose of authentication, we * don't have any auth. */ bc->exchange_auth.method = TALER_BANK_AUTH_NONE; - bc->exchange_payto = TALER_payto_xtalerbank_make (bc->bank_url, "2"); - bc->user42_payto = TALER_payto_xtalerbank_make (bc->bank_url, "42"); - bc->user43_payto = TALER_payto_xtalerbank_make (bc->bank_url, "43"); + bc->exchange_payto = "payto://x-taler-bank/localhost/2"; + bc->user42_payto = "payto://x-taler-bank/localhost/42"; + bc->user43_payto = "payto://x-taler-bank/localhost/43"; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "exchange payto: %s\n", + bc->exchange_payto); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "user42_payto: %s\n", + bc->user42_payto); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "user42_payto: %s\n", + bc->user43_payto); return GNUNET_OK; } |