diff --git a/src/benchmark/benchmark-common.conf b/src/benchmark/benchmark-common.conf index 094b76411..6ff5a727a 100644 --- a/src/benchmark/benchmark-common.conf +++ b/src/benchmark/benchmark-common.conf @@ -16,6 +16,12 @@ BASE_URL="http://localhost:8081/" AGGREGATOR_SHARD_SIZE=67108864 WIREWATCH_IDLE_SLEEP_INTERVAL=5 ms +[exchangedb-postgres] +CONFIG="postgres:///talercheck" + +[exchange-offline] +MASTER_PRIV_FILE=${TALER_DATA_HOME}/exchange/offline-keys/master.priv + [taler-exchange-secmod-rsa] LOOKAHEAD_SIGN="1 d" @@ -26,6 +32,27 @@ LOOKAHEAD_SIGN="1 d" DURATION="2 d" LOOKAHEAD_SIGN="1 d" +# account-2 is suitable for fakebank +[exchange-account-1] +PAYTO_URI = "payto://x-taler-bank/localhost/42?receiver-name=42" +ENABLE_DEBIT = YES +ENABLE_CREDIT = YES + +[exchange-accountcredentials-1] +WIRE_GATEWAY_URL = "http://localhost:8082/42/" + +# account-2 is suitable for libeufin +[exchange-account-2] +ENABLE_DEBIT = YES +ENABLE_CREDIT = YES + +[exchange-accountcredentials-2] +WIRE_GATEWAY_AUTH_METHOD = basic +USERNAME = Exchange +PASSWORD = x +WIRE_GATEWAY_URL = "http://localhost:8082/2/" + + # Trust local exchange for "EUR" currency [merchant-exchange-benchmark] EXCHANGE_BASE_URL = http://localhost:8081/ @@ -35,9 +62,6 @@ MASTER_KEY=98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG CURRENCY = EUR -[exchangedb-postgres] -CONFIG="postgres:///talercheck" - [merchantdb-postgres] CONFIG="postgres:///talercheck" @@ -47,26 +71,15 @@ CONFIG="postgres:///talercheck" [syncdb-postgres] CONFIG="postgres:///talercheck" -[exchange-offline] -MASTER_PRIV_FILE=${TALER_DATA_HOME}/exchange/offline-keys/master.priv - [bank] HTTP_PORT=8082 SERVE=http -MAX_DEBT=EUR:100000000000.0 -MAX_DEBT_BANK=EUR:1000000000000000.0 -DATABASE=bank-db.sqlite3 [libeufin-nexus] DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432" -#DB_CONNECTION="jdbc:sqlite:libeufin-nexus.sqlite3" [libeufin-sandbox] DB_CONNECTION="jdbc:postgresql://localhost/talercheck?socketFactory=org.newsclub.net.unix.AFUNIXSocketFactory$FactoryArg&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432" -#DB_CONNECTION="jdbc:sqlite:libeufin-sandbox.sqlite3" [auditor] BASE_URL="http://localhost:8083/" - -[benchmark] -USER_PAYTO_URI="payto://x-taler-bank/localhost:8082/42?receiver-name=user42" diff --git a/src/benchmark/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv b/src/benchmark/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv deleted file mode 100644 index 394926938..000000000 --- a/src/benchmark/exchange_benchmark_home/.local/share/taler/exchange/offline-keys/master.priv +++ /dev/null @@ -1 +0,0 @@ -p^-33XX!\0qmU_ \ No newline at end of file diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index cc93a4201..9623a5a30 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -849,6 +849,9 @@ build_wire_state (void) wire_method = TALER_payto_get_method (payto_uri); if (NULL == wire_method) { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "No wire method in `%s'\n", + payto_uri); wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR; wsh->wire_reply = TALER_MHD_make_error ( @@ -888,25 +891,20 @@ build_wire_state (void) GNUNET_CRYPTO_hash_context_abort (hc); return wsh; } - if (0 == json_array_size (ac.a)) + if (0 != json_array_size (ac.a)) + { + wsh->cache_expiration + = GNUNET_TIME_absolute_min (ac.max_seen, + wsh->cache_expiration); + GNUNET_assert (0 == + json_object_set_new (wire_fee_object, + wire_method, + ac.a)); + } + else { json_decref (ac.a); - json_decref (wire_accounts_array); - json_decref (wire_fee_object); - wsh->http_status = MHD_HTTP_INTERNAL_SERVER_ERROR; - wsh->wire_reply - = TALER_MHD_make_error (TALER_EC_EXCHANGE_WIRE_FEES_NOT_CONFIGURED, - wire_method); - GNUNET_free (wire_method); - GNUNET_CRYPTO_hash_context_abort (hc); - return wsh; } - wsh->cache_expiration = GNUNET_TIME_absolute_min (ac.max_seen, - wsh->cache_expiration); - GNUNET_assert (0 == - json_object_set_new (wire_fee_object, - wire_method, - ac.a)); } GNUNET_free (wire_method); } @@ -2438,6 +2436,11 @@ create_krd (struct TEH_KeyStateHandle *ksh, json_t *keys; wsh = get_wire_state (); + if (MHD_HTTP_OK != wsh->http_status) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } GNUNET_assert (! GNUNET_TIME_absolute_is_zero ( last_cherry_pick_date.abs_time)); GNUNET_assert (NULL != signkeys); diff --git a/src/testing/test_exchange_api.conf b/src/testing/test_exchange_api.conf index 8f7bb930e..6a285f55d 100644 --- a/src/testing/test_exchange_api.conf +++ b/src/testing/test_exchange_api.conf @@ -28,21 +28,21 @@ PORT = 8081 MASTER_PUBLIC_KEY = 98NJW3CQHZQGQXTY3K85K531XKPAPAVV4Q5V8PYYRR00NJGZWNVG DB = postgres BASE_URL = "http://localhost:8081/" -EXPIRE_SHARD_SIZE = 300 ms -EXPIRE_IDLE_SLEEP_INTERVAL = 1 s +EXPIRE_SHARD_SIZE ="300 ms" +EXPIRE_IDLE_SLEEP_INTERVAL ="1 s" [exchangedb-postgres] CONFIG = "postgres:///talercheck" [taler-exchange-secmod-cs] -LOOKAHEAD_SIGN = 24 days +LOOKAHEAD_SIGN = "24 days" [taler-exchange-secmod-rsa] -LOOKAHEAD_SIGN = 24 days +LOOKAHEAD_SIGN = "24 days" [taler-exchange-secmod-eddsa] -LOOKAHEAD_SIGN = 24 days -DURATION = 14 days +LOOKAHEAD_SIGN = "24 days" +DURATION = "14 days" [exchange-account-1]