diff options
author | Florian Dold <florian@dold.me> | 2024-11-18 19:30:20 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-11-18 19:30:30 +0100 |
commit | d72c1470c2562b7e4d99108e27ec3d6508b1b625 (patch) | |
tree | 2be01ce2fdcedd12e6663e276afb15ac73d11809 | |
parent | 7524e8b823964875670f3f7332ccb1c652117650 (diff) |
harness: adjust tests for new config handling
28 files changed, 97 insertions, 71 deletions
diff --git a/packages/taler-harness/src/env-full.ts b/packages/taler-harness/src/env-full.ts index 64f514c91..e05e7f023 100644 --- a/packages/taler-harness/src/env-full.ts +++ b/packages/taler-harness/src/env-full.ts @@ -50,7 +50,6 @@ export async function runEnvFull(t: GlobalTestState): Promise<void> { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/harness/environments.ts b/packages/taler-harness/src/harness/environments.ts index 370ba2869..bba81c348 100644 --- a/packages/taler-harness/src/harness/environments.ts +++ b/packages/taler-harness/src/harness/environments.ts @@ -221,7 +221,6 @@ export async function useSharedTestkudosEnvironment(t: GlobalTestState) { } else { merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, overrideTestDir: sharedDir, @@ -349,7 +348,6 @@ export async function createSimpleTestkudosEnvironmentV2( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); @@ -475,7 +473,6 @@ export async function createSimpleTestkudosEnvironmentV3( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); @@ -702,7 +699,6 @@ export async function createFaultInjectedMerchantTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); @@ -1223,7 +1219,6 @@ export async function createKycTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/harness/faultInjection.ts b/packages/taler-harness/src/harness/faultInjection.ts index f4d7fc4b9..18da0b7e5 100644 --- a/packages/taler-harness/src/harness/faultInjection.ts +++ b/packages/taler-harness/src/harness/faultInjection.ts @@ -26,11 +26,11 @@ import * as http from "http"; import { URL } from "url"; import { - GlobalTestState, ExchangeService, ExchangeServiceInterface, - MerchantServiceInterface, + GlobalTestState, MerchantService, + MerchantServiceInterface, } from "../harness/harness.js"; export interface FaultProxyConfig { @@ -171,9 +171,8 @@ export class FaultProxy { } if (faultRespContext.responseBody) { // We must accommodate for potentially changed content length - faultRespContext.responseHeaders[ - "content-length" - ] = `${faultRespContext.responseBody.byteLength}`; + faultRespContext.responseHeaders["content-length"] = + `${faultRespContext.responseBody.byteLength}`; } console.log("writing response head"); res.writeHead( @@ -235,6 +234,10 @@ export class FaultInjectedExchangeService implements ExchangeServiceInterface { this.baseUrl = exchangeUrl.href; this.port = proxyInboundPort; } + + get currency(): string { + return this.innerExchange.currency; + } } export class FaultInjectedMerchantService implements MerchantServiceInterface { diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts index 339e6e84d..b4ec2604a 100644 --- a/packages/taler-harness/src/harness/harness.ts +++ b/packages/taler-harness/src/harness/harness.ts @@ -27,6 +27,7 @@ import { AmountJson, Amounts, + ConfigSources, Configuration, CoreApiResponse, Duration, @@ -680,10 +681,10 @@ export class FakebankService gc: GlobalTestState, bc: BankConfig, ): Promise<FakebankService> { - const config = new Configuration(); + const config = new Configuration(ConfigSources["taler-exchange"]); const testDir = bc.overrideTestDir ?? gc.testDir; setTalerPaths(config, testDir + "/talerhome"); - config.setString("taler", "currency", bc.currency); + config.setString("exchange", "currency", bc.currency); config.setString("bank", "http_port", `${bc.httpPort}`); config.setString("bank", "serve", "http"); config.setString("bank", "max_debt_bank", `${bc.currency}:999999`); @@ -701,11 +702,14 @@ export class FakebankService ): FakebankService { const testDir = opts.overridePath ?? gc.testDir; const cfgFilename = testDir + `/bank.conf`; - const config = Configuration.load(cfgFilename); + const config = Configuration.load( + cfgFilename, + ConfigSources["taler-exchange"], + ); const bc: BankConfig = { allowRegistrations: config.getYesNo("bank", "allow_registrations").orUndefined() ?? true, - currency: config.getString("taler", "currency").required(), + currency: config.getString("exchange", "currency").required(), database: "none", httpPort: config.getNumber("bank", "http_port").required(), maxDebt: config.getString("bank", "max_debt").required(), @@ -717,7 +721,10 @@ export class FakebankService if (!!this.proc) { throw Error("Can't set suggested exchange while bank is running."); } - const config = Configuration.load(this.configFile); + const config = Configuration.load( + this.configFile, + ConfigSources["taler-exchange"], + ); config.setString("bank", "suggested_exchange", e.baseUrl); config.writeTo(this.configFile, { excludeDefaults: true }); } @@ -866,7 +873,10 @@ export class LibeufinBankService ): FakebankService { const testDir = opts.overridePath ?? gc.testDir; const cfgFilename = testDir + `/bank.conf`; - const config = Configuration.load(cfgFilename); + const config = Configuration.load( + cfgFilename, + ConfigSources["libeufin-bank"], + ); console.log("conf THERE " + cfgFilename); const bc: BankConfig = { allowRegistrations: @@ -888,7 +898,10 @@ export class LibeufinBankService if (!!this.proc) { throw Error("Can't set suggested exchange while bank is running."); } - const config = Configuration.load(this.configFile); + const config = Configuration.load( + this.configFile, + ConfigSources["taler-exchange"], + ); config.setString( "libeufin-bank", "suggested_withdrawal_exchange", @@ -995,6 +1008,7 @@ export interface ExchangeServiceInterface { readonly port: number; readonly name: string; readonly masterPub: string; + readonly currency: string; } export class ExchangeService implements ExchangeServiceInterface { @@ -1005,13 +1019,16 @@ export class ExchangeService implements ExchangeServiceInterface { ) { const testDir = opts.overridePath ?? gc.testDir; const cfgFilename = testDir + `/exchange-${exchangeName}.conf`; - const config = Configuration.load(cfgFilename); + const config = Configuration.load( + cfgFilename, + ConfigSources["taler-exchange"], + ); const ec: ExchangeConfig = { - currency: config.getString("taler", "currency").required(), + currency: config.getString("exchange", "currency").required(), database: config.getString("exchangedb-postgres", "config").required(), httpPort: config.getNumber("exchange", "port").required(), name: exchangeName, - roundUnit: config.getString("taler", "currency_round_unit").required(), + roundUnit: config.getString("exchange", "currency_round_unit").required(), }; const privFile = config .getPath("exchange-offline", "master_priv_file") @@ -1065,6 +1082,10 @@ export class ExchangeService implements ExchangeServiceInterface { ); } + get currency() { + return this.exchangeConfig.currency; + } + async runAggregatorOnceWithTimetravel(opts: { timetravelMicroseconds: number; }) { @@ -1122,7 +1143,10 @@ export class ExchangeService implements ExchangeServiceInterface { } changeConfig(f: (config: Configuration) => void) { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); f(config); config.writeTo(this.configFilename, { excludeDefaults: true }); } @@ -1131,11 +1155,11 @@ export class ExchangeService implements ExchangeServiceInterface { const testDir = e.overrideTestDir ?? gc.testDir; const config = new Configuration(); setTalerPaths(config, `${testDir}/talerhome-exchange-${e.name}`, e.name); - config.setString("taler", "currency", e.currency); + config.setString("exchange", "currency", e.currency); // Required by the exchange but not really used yet. config.setString("exchange", "aml_threshold", `${e.currency}:1000000`); config.setString( - "taler", + "exchange", "currency_round_unit", e.roundUnit ?? `${e.currency}:0.01`, ); @@ -1195,7 +1219,10 @@ export class ExchangeService implements ExchangeServiceInterface { } addOfferedCoins(offeredCoins: ((curr: string) => CoinConfig)[]) { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); offeredCoins.forEach((cc) => setCoin(config, cc(this.exchangeConfig.currency)), ); @@ -1203,13 +1230,19 @@ export class ExchangeService implements ExchangeServiceInterface { } addCoinConfigList(ccs: CoinConfig[]) { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); ccs.forEach((cc) => setCoin(config, cc)); config.writeTo(this.configFilename, { excludeDefaults: true }); } enableAgeRestrictions(maskStr: string) { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); config.setString("exchange-extension-age_restriction", "enabled", "yes"); config.setString( "exchange-extension-age_restriction", @@ -1235,7 +1268,10 @@ export class ExchangeService implements ExchangeServiceInterface { async modifyConfig( f: (config: Configuration) => Promise<void>, ): Promise<void> { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); await f(config); config.writeTo(this.configFilename, { excludeDefaults: true }); } @@ -1245,7 +1281,10 @@ export class ExchangeService implements ExchangeServiceInterface { exchangeBankAccount: HarnessExchangeBankAccount, ): Promise<void> { this.exchangeBankAccounts.push(exchangeBankAccount); - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); config.setString( `exchange-account-${localName}`, "wire_response", @@ -1521,7 +1560,10 @@ export class ExchangeService implements ExchangeServiceInterface { } async purgeSecmodKeys(): Promise<void> { - const cfg = Configuration.load(this.configFilename); + const cfg = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); const rsaKeydir = cfg .getPath("taler-exchange-secmod-rsa", "KEY_DIR") .required(); @@ -1537,7 +1579,10 @@ export class ExchangeService implements ExchangeServiceInterface { * Generate a new master public key for the exchange. */ async regenerateMasterPub(): Promise<void> { - const cfg = Configuration.load(this.configFilename); + const cfg = Configuration.load( + this.configFilename, + ConfigSources["taler-exchange"], + ); const masterPrivFile = cfg .getPath("exchange-offline", "master_priv_file") .required(); @@ -1687,7 +1732,6 @@ export class ExchangeService implements ExchangeServiceInterface { export interface MerchantConfig { name: string; - currency: string; httpPort: number; database: string; overrideTestDir?: string; @@ -1714,9 +1758,11 @@ export class MerchantService implements MerchantServiceInterface { ) { const testDir = opts.overridePath ?? gc.testDir; const cfgFilename = testDir + `/merchant-${name}.conf`; - const config = Configuration.load(cfgFilename); + const config = Configuration.load( + cfgFilename, + ConfigSources["taler-merchant"], + ); const mc: MerchantConfig = { - currency: config.getString("taler", "currency").required(), database: config.getString("merchantdb-postgres", "config").required(), httpPort: config.getNumber("merchant", "port").required(), name, @@ -1882,7 +1928,6 @@ export class MerchantService implements MerchantServiceInterface { ): Promise<MerchantService> { const testDir = mc.overrideTestDir ?? gc.testDir; const config = new Configuration(); - config.setString("taler", "currency", mc.currency); const cfgFilename = testDir + `/merchant-${mc.name}.conf`; setTalerPaths(config, testDir + "/talerhome"); @@ -1902,17 +1947,16 @@ export class MerchantService implements MerchantServiceInterface { } addExchange(e: ExchangeServiceInterface): void { - const config = Configuration.load(this.configFilename); + const config = Configuration.load( + this.configFilename, + ConfigSources["taler-merchant"], + ); config.setString( `merchant-exchange-${e.name}`, "exchange_base_url", e.baseUrl, ); - config.setString( - `merchant-exchange-${e.name}`, - "currency", - this.merchantConfig.currency, - ); + config.setString(`merchant-exchange-${e.name}`, "currency", e.currency); config.setString(`merchant-exchange-${e.name}`, "master_key", e.masterPub); config.writeTo(this.configFilename, { excludeDefaults: true }); } diff --git a/packages/taler-harness/src/index.ts b/packages/taler-harness/src/index.ts index 4a95d8c49..f209c1906 100644 --- a/packages/taler-harness/src/index.ts +++ b/packages/taler-harness/src/index.ts @@ -1257,7 +1257,7 @@ deploymentCli let n = 1; out += "# Coin configuration for the exchange.\n"; - out += '# Should be placed in "/etc/taler/conf.d/exchange-coins.conf".\n'; + out += '# Should be placed in "/etc/taler/config.d/exchange-coins.conf".\n'; out += "\n"; while (Amounts.cmp(x, coinMax) < 0) { diff --git a/packages/taler-harness/src/integrationtests/test-bank-api.ts b/packages/taler-harness/src/integrationtests/test-bank-api.ts index e08abc847..a64c3770e 100644 --- a/packages/taler-harness/src/integrationtests/test-bank-api.ts +++ b/packages/taler-harness/src/integrationtests/test-bank-api.ts @@ -58,7 +58,6 @@ export async function runBankApiTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-currency-scope.ts b/packages/taler-harness/src/integrationtests/test-currency-scope.ts index d7a479bc7..8bf1c265a 100644 --- a/packages/taler-harness/src/integrationtests/test-currency-scope.ts +++ b/packages/taler-harness/src/integrationtests/test-currency-scope.ts @@ -69,7 +69,6 @@ export async function runCurrencyScopeTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: dbDefault.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-exchange-management-fault.ts b/packages/taler-harness/src/integrationtests/test-exchange-management-fault.ts index ae8f377e9..966d8f436 100644 --- a/packages/taler-harness/src/integrationtests/test-exchange-management-fault.ts +++ b/packages/taler-harness/src/integrationtests/test-exchange-management-fault.ts @@ -66,7 +66,6 @@ export async function runExchangeManagementFaultTest( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts b/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts index 43efe498a..c501baf8d 100644 --- a/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts +++ b/packages/taler-harness/src/integrationtests/test-exchange-timetravel.ts @@ -120,7 +120,6 @@ export async function runExchangeTimetravelTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-fee-regression.ts b/packages/taler-harness/src/integrationtests/test-fee-regression.ts index 969954483..011b490d0 100644 --- a/packages/taler-harness/src/integrationtests/test-fee-regression.ts +++ b/packages/taler-harness/src/integrationtests/test-fee-regression.ts @@ -62,7 +62,6 @@ export async function createMyTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts b/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts index 1e76ef8bf..45443c781 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc-merchant-aggregate.ts @@ -188,7 +188,6 @@ async function createKycTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-kyc.ts b/packages/taler-harness/src/integrationtests/test-kyc.ts index be6bbb2f4..a5882c661 100644 --- a/packages/taler-harness/src/integrationtests/test-kyc.ts +++ b/packages/taler-harness/src/integrationtests/test-kyc.ts @@ -73,7 +73,6 @@ async function createKycTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-libeufin-bank.ts b/packages/taler-harness/src/integrationtests/test-libeufin-bank.ts index e7b71c733..eaf5884dd 100644 --- a/packages/taler-harness/src/integrationtests/test-libeufin-bank.ts +++ b/packages/taler-harness/src/integrationtests/test-libeufin-bank.ts @@ -67,7 +67,6 @@ export async function runLibeufinBankTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-merchant-categories.ts b/packages/taler-harness/src/integrationtests/test-merchant-categories.ts index 21ccfef3a..c22fff405 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-categories.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-categories.ts @@ -44,7 +44,6 @@ export async function runMerchantCategoriesTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts index 4168b7092..01c107fa9 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-exchange-confusion.ts @@ -74,7 +74,6 @@ export async function createConfusedMerchantTestkudosEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances-delete.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances-delete.ts index 51beded8d..a26d93577 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-instances-delete.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-instances-delete.ts @@ -44,7 +44,6 @@ export async function runMerchantInstancesDeleteTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts index b631ea1a4..b30cb0c17 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-instances-urls.ts @@ -41,7 +41,6 @@ export async function runMerchantInstancesUrlsTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-merchant-instances.ts b/packages/taler-harness/src/integrationtests/test-merchant-instances.ts index f41b028ae..982b1ea73 100644 --- a/packages/taler-harness/src/integrationtests/test-merchant-instances.ts +++ b/packages/taler-harness/src/integrationtests/test-merchant-instances.ts @@ -44,7 +44,6 @@ export async function runMerchantInstancesTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-multiexchange.ts b/packages/taler-harness/src/integrationtests/test-multiexchange.ts index 15fb4d6b1..c03948f62 100644 --- a/packages/taler-harness/src/integrationtests/test-multiexchange.ts +++ b/packages/taler-harness/src/integrationtests/test-multiexchange.ts @@ -74,7 +74,6 @@ export async function runMultiExchangeTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: dbDefault.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-payment-fault.ts b/packages/taler-harness/src/integrationtests/test-payment-fault.ts index 638620c14..cd78d69a0 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-fault.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-fault.ts @@ -127,7 +127,6 @@ export async function runPaymentFaultTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-payment-multiple.ts b/packages/taler-harness/src/integrationtests/test-payment-multiple.ts index 8f8e1769b..8be485201 100644 --- a/packages/taler-harness/src/integrationtests/test-payment-multiple.ts +++ b/packages/taler-harness/src/integrationtests/test-payment-multiple.ts @@ -100,7 +100,6 @@ async function setupTest(t: GlobalTestState): Promise<{ const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-revocation.ts b/packages/taler-harness/src/integrationtests/test-revocation.ts index c49df3b63..e2003aa7a 100644 --- a/packages/taler-harness/src/integrationtests/test-revocation.ts +++ b/packages/taler-harness/src/integrationtests/test-revocation.ts @@ -85,7 +85,6 @@ async function createTestEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts index c9aac0aa7..955e44065 100644 --- a/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts +++ b/packages/taler-harness/src/integrationtests/test-timetravel-autorefresh.ts @@ -66,7 +66,6 @@ export async function runTimetravelAutorefreshTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-wallet-balance.ts b/packages/taler-harness/src/integrationtests/test-wallet-balance.ts index c18d515d8..53f7b6aff 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-balance.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-balance.ts @@ -84,7 +84,6 @@ async function createMyEnvironment( const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-wallet-notifications.ts b/packages/taler-harness/src/integrationtests/test-wallet-notifications.ts index d48c6570b..d7002ba20 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-notifications.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-notifications.ts @@ -66,7 +66,6 @@ export async function runWalletNotificationsTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-wallet-wirefees.ts b/packages/taler-harness/src/integrationtests/test-wallet-wirefees.ts index 27fbab3cd..803032d4c 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-wirefees.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-wirefees.ts @@ -66,7 +66,6 @@ export async function runWalletWirefeesTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-harness/src/integrationtests/test-withdrawal-conversion.ts b/packages/taler-harness/src/integrationtests/test-withdrawal-conversion.ts index ca854422c..3ad6300d7 100644 --- a/packages/taler-harness/src/integrationtests/test-withdrawal-conversion.ts +++ b/packages/taler-harness/src/integrationtests/test-withdrawal-conversion.ts @@ -152,7 +152,6 @@ export async function runWithdrawalConversionTest(t: GlobalTestState) { const merchant = await MerchantService.create(t, { name: "testmerchant-1", - currency: "TESTKUDOS", httpPort: 8083, database: db.connStr, }); diff --git a/packages/taler-util/src/talerconfig.ts b/packages/taler-util/src/talerconfig.ts index 2bd7b355f..06ed588be 100644 --- a/packages/taler-util/src/talerconfig.ts +++ b/packages/taler-util/src/talerconfig.ts @@ -91,12 +91,19 @@ export interface ConfigSource { export type ConfigSourceDef = { [x: string]: ConfigSource | undefined }; export const ConfigSources = { - ["taler"]: { - projectName: "taler", - componentName: "taler", - installPathBinary: "taler-config", - baseConfigVarname: "TALER_BASE_CONFIG", - prefixVarname: "TALER_PREFIX", + ["taler-exchange"]: { + projectName: "taler-exchange", + componentName: "taler-exchange", + installPathBinary: "taler-exchange-config", + baseConfigVarname: "TALER_EXCHANGE_BASE_CONFIG", + prefixVarname: "TALER_EXCHANGE_PREFIX", + } satisfies ConfigSource, + ["taler-merchant"]: { + projectName: "taler-merchant", + componentName: "taler-merchant", + installPathBinary: "taler-merchant-config", + baseConfigVarname: "TALER_MERCHANT_BASE_CONFIG", + prefixVarname: "TALER_MERCHANT_PREFIX", } satisfies ConfigSource, ["libeufin-bank"]: { projectName: "libeufin", @@ -121,7 +128,7 @@ export const ConfigSources = { } satisfies ConfigSource, } satisfies ConfigSourceDef; -const defaultConfigSource: ConfigSource = ConfigSources.taler; +const defaultConfigSource: ConfigSource = ConfigSources["taler-exchange"]; export class ConfigValue<T> { constructor( |