config syntax for accounts

This commit is contained in:
Florian Dold 2020-01-19 18:48:14 +01:00
parent c1dc7cc28b
commit 6074790867
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B
26 changed files with 45 additions and 48 deletions

View File

@ -77,7 +77,7 @@ lookahead_provide = 4 weeks 1 day
[taler]
CURRENCY = TESTKUDOS
[account-1]
[exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
@ -88,7 +88,7 @@ WIRE_GATEWAY_AUTH_METHOD = basic
USERNAME = Exchange
PASSWORD = x
[account-merchant]
[merchant-account-merchant]
PAYTO_URI = payto://x-taler-bank/localhost/42
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/merchant/account-3.json
METHOD = x-taler-bank

View File

@ -2,7 +2,7 @@
DB = postgres
TINY_AMOUNT = TESTKUDOS:0.01
[account-1]
[exchange-account-1]
WIRE_RESPONSE = ${TALER_DATA_HOME}/exchange/account-1.json
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank

View File

@ -43,7 +43,7 @@ dir = $HOME/repos/taler/exchange/src/benchmark
[benchmark]
USER_PAYTO_URI = payto://x-taler-bank/localhost:8082/42
[account-2]
[exchange-account-2]
# What is the payto://-URL of the exchange (to generate wire response)
PAYTO_URI = "payto://x-taler-bank/localhost:8082/2"
# What is the bank account (with the "Taler Bank" demo system)? Must end with "/".

View File

@ -205,9 +205,9 @@ static void
pick_exchange_account_cb (void *cls,
const char *section)
{
if (0 == strncasecmp ("account-",
if (0 == strncasecmp ("exchange-account-",
section,
strlen ("account-")))
strlen ("exchange-account-")))
{
const char **s = cls;

View File

@ -46,7 +46,7 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
[exchangedb-postgres]
CONFIG = "postgres:///talercheck"
[account-1]
[exchange-account-1]
PAYTO_URI = "payto://x-taler-bank/localhost:8082/3"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-1.json
METHOD = "x-taler-bank"
@ -55,7 +55,7 @@ ENABLE_CREDIT = YES
TALER_BANK_AUTH_METHOD = NONE
# Wire fees are specified by wire method, NOT by wire plugin.
# Wire fees are specified by wire method
[fees-x-taler-bank]
# Fees for the forseeable future...
# If you see this after 2018, update to match the next 10 years...

View File

@ -50,9 +50,6 @@ struct FindAccountContext
* true, call the callback from the context with the
* rest of the section name.
*
* FIXME(dold): This comment is inaccurate! Also, why
* is the prefix "account-" and not "exchange-account-"?
*
* @param cls our `struct FindEnabledWireContext`
* @param section name of a section in the configuration
*/
@ -67,8 +64,8 @@ check_for_account (void *cls,
struct TALER_EXCHANGEDB_AccountInfo ai;
if (0 != strncasecmp (section,
"account-",
strlen ("account-")))
"exchange-account-",
strlen ("exchange-account-")))
return;
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (ctx->cfg,

View File

@ -1533,7 +1533,7 @@ run (void *cls)
FAILIF (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS !=
plugin->get_latest_reserve_in_reference (plugin->cls,
session,
"account-1",
"exchange-account-1",
&rr));
now = GNUNET_TIME_absolute_get ();
(void) GNUNET_TIME_round_abs (&now);
@ -1544,12 +1544,12 @@ run (void *cls)
&value,
now,
sndr,
"account-1",
"exchange-account-1",
4));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls,
session,
"account-1",
"exchange-account-1",
&rr));
FAILIF (4 != rr);
FAILIF (GNUNET_OK !=
@ -1567,17 +1567,17 @@ run (void *cls)
&value,
now,
sndr,
"account-1",
"exchange-account-1",
5));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls,
session,
"account-1",
"exchange-account-1",
&rr));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->get_latest_reserve_in_reference (plugin->cls,
session,
"account-1",
"exchange-account-1",
&rr));
FAILIF (5 != rr);
FAILIF (GNUNET_OK !=

View File

@ -389,7 +389,7 @@ struct TALER_EXCHANGEDB_AccountInfo
{
/**
* Section in the configuration file that specifies the
* account. Must start with "account-".
* account. Must start with "exchange-account-".
*/
const char *section_name;

View File

@ -54,7 +54,7 @@ IDLE_RESERVE_EXPIRATION_TIME = 4 weeks
# the legal expiration timeframe of withdrawn coins.
LEGAL_RESERVE_EXPIRATION_TIME = 7 years
[account-1]
[exchange-account-1]
# What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -43,7 +43,7 @@ BASE_URL = "http://localhost:8083/"
# HTTP port the auditor listens to
PORT = 8083
[account-1]
[exchange-account-1]
# What is the account URL?
PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -673,7 +673,7 @@ main (int argc,
/* Check fakebank port is available and get configuration data. */
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2",
"exchange-account-2",
&bc))
return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -51,13 +51,13 @@ CONFIG = "postgres:///talercheck"
[auditordb-postgres]
CONFIG = "postgres:///talercheck"
# Sections starting with "account-" configure the bank accounts
# Sections starting with "exchange-account-" configure the bank accounts
# of the exchange. The "URL" specifies the account in
# payto://-format, while the WIRE_JSON specifies the
# (possibly offline) signed version to be returned in /wire.
# WIRE_JSON is optional, as not all accounts must be
# advertised in /wire.
[account-1]
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
WIRE_GATEWAY_URL = "http://localhost:8082/42/"
@ -73,7 +73,7 @@ HTTP_PORT = 8082
# ENABLE_CREDIT = YES
[account-2]
[exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)?
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -137,7 +137,7 @@ main (int argc,
cfgfilename = CONFIG_FILE_FAKEBANK;
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE_FAKEBANK,
"account-2",
"exchange-account-2",
&bc))
{
GNUNET_break (0);
@ -150,7 +150,7 @@ main (int argc,
cfgfilename = CONFIG_FILE_PYBANK;
if (GNUNET_OK !=
TALER_TESTING_prepare_bank (CONFIG_FILE_PYBANK,
"account-2",
"exchange-account-2",
&bc))
{
GNUNET_break (0);

View File

@ -3,7 +3,7 @@
[taler]
currency = KUDOS
[account-2]
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8081/2/"

View File

@ -27,8 +27,8 @@ serve = http
http_port = 8081
database = postgres:///talercheck
[account-1]
[exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost:8081/1
[account-2]
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost:8081/2

View File

@ -3,7 +3,7 @@
[taler]
currency = KUDOS
[account-2]
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8081/taler-wire-gateway/Exchange/"

View File

@ -29,11 +29,11 @@ http_port = 8081
database = postgres:///talercheck
[account-1]
[exchange-account-1]
PAYTO_URI = payto://x-taler-bank/localhost/1
[account-2]
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/Exchange
METHOD = x-taler-bank
WIRE_GATEWAY_URL = "http://localhost:8888/taler-wire-gateway/Exchange/"

View File

@ -164,7 +164,7 @@ main (int argc,
TALER_LOG_DEBUG ("Running against the Fakebank.\n");
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (cfgfilename,
"account-2",
"exchange-account-2",
&bc))
{
GNUNET_break (0);
@ -177,7 +177,7 @@ main (int argc,
TALER_LOG_DEBUG ("Running against the Pybank.\n");
if (GNUNET_OK !=
TALER_TESTING_prepare_bank (cfgfilename,
"account-2",
"exchange-account-2",
&bc))
{
GNUNET_break (0);

View File

@ -795,7 +795,7 @@ main (int argc,
/* Check fakebank port is available and get config */
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2",
"exchange-account-2",
&bc))
return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -52,13 +52,13 @@ CONFIG = "postgres:///talercheck"
[auditordb-postgres]
CONFIG = "postgres:///talercheck"
# Sections starting with "account-" configure the bank accounts
# Sections starting with "exchange-account-" configure the bank accounts
# of the exchange. The "URL" specifies the account in
# payto://-format, while the WIRE_JSON specifies the
# (possibly offline) signed version to be returned in /wire.
# WIRE_JSON is optional, as not all accounts must be
# advertised in /wire.
[account-1]
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides
@ -72,7 +72,7 @@ WIRE_GATEWAY_URL = "http://localhost:9081/42/"
# ENABLE_CREDIT = YES
[account-2]
[exchange-account-2]
# What is the bank account (with the "Taler Bank" demo system)?
PAYTO_URI = "payto://x-taler-bank/localhost/2"

View File

@ -65,7 +65,7 @@ CONFIG = "postgres:///talercheck"
CONFIG = "postgres:///talercheck"
[account-1]
[exchange-account-1]
# 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}/iban.json
@ -78,7 +78,7 @@ METHOD = "x-taler-bank"
WIRE_GATEWAY_URL = "http://localhost:9082/42/"
[account-2]
[exchange-account-2]
# 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}/x-taler-bank.json

View File

@ -194,7 +194,7 @@ main (int argc,
/* Check fakebank port is available and get config */
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2",
"exchange-account-2",
&bc))
return 77;
TALER_TESTING_cleanup_files (CONFIG_FILE);

View File

@ -288,7 +288,7 @@ main (int argc,
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (CONFIG_FILE,
"account-2",
"exchange-account-2",
&bc))
return 77;

View File

@ -56,7 +56,7 @@ PORT = 8083
[auditordb-postgres]
CONFIG = "postgres:///talercheck"
[account-1]
[exchange-account-1]
# What is the URL of our account?
PAYTO_URI = "payto://x-taler-bank/localhost/42"
# This is the response we give out for the /wire request. It provides
@ -68,7 +68,7 @@ WIRE_GATEWAY_URL = "http://localhost:9081/42/"
WIRE_GATEWAY_AUTH_METHOD = NONE
[account-2]
[exchange-account-2]
PAYTO_URI = payto://x-taler-bank/localhost/2
WIRE_GATEWAY_URL = "http://localhost:8082/2/"
WIRE_RESPONSE = ${TALER_CONFIG_HOME}/account-2.json

View File

@ -492,7 +492,7 @@ main (int argc,
}
if (GNUNET_OK != TALER_TESTING_prepare_fakebank (config_filename,
"account-1",
"exchange-account-1",
&bc))
{
TALER_LOG_WARNING ("Could not prepare the fakebank\n");

View File

@ -168,7 +168,7 @@ main (int argc,
if (GNUNET_OK !=
TALER_TESTING_prepare_fakebank (config_filename,
"account-1",
"exchange-account-1",
&bc))
return 77;