aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-10-12 22:27:50 +0200
committerFlorian Dold <florian@dold.me>2022-10-12 22:27:50 +0200
commitded00b680a776d03cd8c928354c87c0be8690f56 (patch)
tree2608e9c7ba1ce8bfb105a421c56cdc201a78f3c9 /packages/taler-wallet-core/src/wallet.ts
parent3da1e82a245851c384c22293c928fcef1c4c2f34 (diff)
downloadwallet-core-ded00b680a776d03cd8c928354c87c0be8690f56.tar.xz
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.ts9
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,