diff options
author | Florian Dold <florian@dold.me> | 2022-10-12 22:27:50 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-12 22:27:50 +0200 |
commit | ded00b680a776d03cd8c928354c87c0be8690f56 (patch) | |
tree | 2608e9c7ba1ce8bfb105a421c56cdc201a78f3c9 /packages/taler-wallet-core/src/wallet.ts | |
parent | 3da1e82a245851c384c22293c928fcef1c4c2f34 (diff) |
wallet-core: implement enabling/disabling dev mode
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index e25b4bd95..48d379931 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -105,12 +105,13 @@ import { AuditorTrustRecord, CoinSourceType, CoinStatus, + ConfigRecordKey, DenominationRecord, exportDb, importDb, WalletStoresV1, } from "./db.js"; -import { applyDevExperiment } from "./dev-experiments.js"; +import { applyDevExperiment, maybeInitDevMode } from "./dev-experiments.js"; import { getErrorDetailFromException, TalerError } from "./errors.js"; import { ActiveLongpollInfo, @@ -476,7 +477,7 @@ async function fillDefaults(ws: InternalWalletState): Promise<void> { provideExchangeRecordInTx(ws, tx, baseUrl, now); } await tx.config.put({ - key: "currencyDefaultsApplied", + key: ConfigRecordKey.CurrencyDefaultsApplied, value: true, }); }); @@ -970,6 +971,7 @@ async function dispatchRequestInternal( logger.trace("filling defaults"); await fillDefaults(ws); } + await maybeInitDevMode(ws); return {}; } case "withdrawTestkudos": { @@ -1339,6 +1341,7 @@ async function dispatchRequestInternal( exchange: WALLET_EXCHANGE_PROTOCOL_VERSION, merchant: WALLET_MERCHANT_PROTOCOL_VERSION, bank: WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, + devMode: ws.devModeActive, }; return version; } @@ -1480,6 +1483,8 @@ class InternalWalletStateImpl implements InternalWalletState { initCalled = false; + devModeActive = false; + exchangeOps: ExchangeOperations = { getExchangeDetails, getExchangeTrust, |