diff options
-rw-r--r-- | packages/taler-wallet-core/src/wallet-api-types.ts | 1 | ||||
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 13 |
2 files changed, 8 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/wallet-api-types.ts b/packages/taler-wallet-core/src/wallet-api-types.ts index daffd40ac..3741105a4 100644 --- a/packages/taler-wallet-core/src/wallet-api-types.ts +++ b/packages/taler-wallet-core/src/wallet-api-types.ts @@ -285,6 +285,7 @@ export interface WalletConfig { devModeActive: boolean; insecureTrustExchange: boolean; preventThrottling: boolean; + skipDefaults: boolean; }; /** diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 3d392583f..79e4cf1a1 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -932,9 +932,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> { ageCommitmentProof: c.ageCommitmentProof, spend_allocation: c.spendAllocation ? { - amount: c.spendAllocation.amount, - id: c.spendAllocation.id, - } + amount: c.spendAllocation.amount, + id: c.spendAllocation.id, + } : undefined, }); } @@ -1064,7 +1064,7 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( case WalletApiOperation.InitWallet: { logger.trace("initializing wallet"); ws.initCalled = true; - if (typeof payload === "object" && (payload as any).skipDefaults) { + if (ws.config.testing.skipDefaults) { logger.trace("skipping defaults"); } else { logger.trace("filling defaults"); @@ -1278,8 +1278,8 @@ async function dispatchRequestInternal<Op extends WalletApiOperation>( url.templateParams.amount !== undefined && typeof url.templateParams.amount === "string" ) { - templateDetails.amount = - (req.templateParams.amount ?? url.templateParams.amount) as AmountString | undefined; + templateDetails.amount = (req.templateParams.amount ?? + url.templateParams.amount) as AmountString | undefined; } if ( url.templateParams.summary !== undefined && @@ -1751,6 +1751,7 @@ export class Wallet { devModeActive: false, insecureTrustExchange: false, denomselAllowLate: false, + skipDefaults: false, }, }; |