aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/harness/harness.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-03-07 11:10:52 +0100
committerFlorian Dold <florian@dold.me>2024-03-07 11:10:52 +0100
commit466e2b7643692aa6b7f76a193b84775008e17350 (patch)
treedd3f9a0b67765e2c7ea6b97c2a7acbbcac71d4b7 /packages/taler-harness/src/harness/harness.ts
parent8eb3e505be967afde0053d5a392e8c6877d8f1dd (diff)
downloadwallet-core-466e2b7643692aa6b7f76a193b84775008e17350.tar.xz
wallet-core: improve insufficient balance reporting
Diffstat (limited to 'packages/taler-harness/src/harness/harness.ts')
-rw-r--r--packages/taler-harness/src/harness/harness.ts62
1 files changed, 38 insertions, 24 deletions
diff --git a/packages/taler-harness/src/harness/harness.ts b/packages/taler-harness/src/harness/harness.ts
index 291cd4c6d..3d9e7fb8a 100644
--- a/packages/taler-harness/src/harness/harness.ts
+++ b/packages/taler-harness/src/harness/harness.ts
@@ -605,6 +605,11 @@ export interface HarnessExchangeBankAccount {
debitRestrictions?: AccountRestriction[];
creditRestrictions?: AccountRestriction[];
+
+ /**
+ * If set, the harness will not automatically configure the wire fee for this account.
+ */
+ skipWireFeeCreation?: boolean;
}
/**
@@ -1320,7 +1325,6 @@ export class ExchangeService implements ExchangeServiceInterface {
if (!p) {
throw Error(`invalid payto uri in exchange config: ${paytoUri}`);
}
- accountTargetTypes.add(p?.targetType);
const optArgs: string[] = [];
if (acct.conversionUrl != null) {
optArgs.push("conversion-url", acct.conversionUrl);
@@ -1339,33 +1343,43 @@ export class ExchangeService implements ExchangeServiceInterface {
"upload",
],
);
- }
- const year = new Date().getFullYear();
- for (const accTargetType of accountTargetTypes.values()) {
- for (let i = year; i < year + 5; i++) {
- await runCommand(
- this.globalState,
- "exchange-offline",
- "taler-exchange-offline",
- [
- "-c",
- this.configFilename,
- "wire-fee",
- // Year
- `${i}`,
- // Wire method
- accTargetType,
- // Wire fee
- `${this.exchangeConfig.currency}:0.01`,
- // Closing fee
- `${this.exchangeConfig.currency}:0.01`,
- "upload",
- ],
- );
+ const accTargetType = p.targetType;
+
+ const covered = accountTargetTypes.has(p.targetType);
+ if (!covered && !acct.skipWireFeeCreation) {
+ const year = new Date().getFullYear();
+
+ for (let i = year; i < year + 5; i++) {
+ await runCommand(
+ this.globalState,
+ "exchange-offline",
+ "taler-exchange-offline",
+ [
+ "-c",
+ this.configFilename,
+ "wire-fee",
+ // Year
+ `${i}`,
+ // Wire method
+ accTargetType,
+ // Wire fee
+ `${this.exchangeConfig.currency}:0.01`,
+ // Closing fee
+ `${this.exchangeConfig.currency}:0.01`,
+ "upload",
+ ],
+ );
+ accountTargetTypes.add(accTargetType);
+ }
}
}
+ const wireTypeConfigured: Set<string> = new Set();
+
+ for (const acct of this.exchangeBankAccounts) {
+ }
+
await runCommand(
this.globalState,
"exchange-offline",