From cd9c3a143bc1ad88ce77d53c212a90f60660069a Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 6 Sep 2023 18:35:43 +0200 Subject: remove deprecated auditor trust management --- packages/taler-wallet-core/src/wallet.ts | 39 +++++--------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) (limited to 'packages/taler-wallet-core/src/wallet.ts') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 9a3b8f235..7a1bd5a4f 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -199,7 +199,6 @@ import { downloadTosFromAcceptedFormat, getExchangeDetails, getExchangeRequestTimeout, - getExchangeTrust, provideExchangeRecordInTx, updateExchangeFromUrl, updateExchangeFromUrlHandler, @@ -527,7 +526,7 @@ async function runTaskLoop( */ async function fillDefaults(ws: InternalWalletState): Promise { await ws.db - .mktx((x) => [x.config, x.auditorTrust, x.exchanges, x.exchangeDetails]) + .mktx((x) => [x.config, x.exchanges, x.exchangeDetails]) .runReadWrite(async (tx) => { const appliedRec = await tx.config.get("currencyDefaultsApplied"); let alreadyApplied = appliedRec ? !!appliedRec.value : false; @@ -535,10 +534,6 @@ async function fillDefaults(ws: InternalWalletState): Promise { logger.trace("defaults already applied"); return; } - logger.info("importing default exchanges and auditors"); - for (const c of ws.config.builtin.auditors) { - await tx.auditorTrust.put(c); - } for (const baseUrl of ws.config.builtin.exchanges) { await addPresetExchangeEntry(tx, baseUrl); const now = AbsoluteTime.now(); @@ -1558,24 +1553,11 @@ async function dispatchRequestInternal( return {}; } case WalletApiOperation.ListCurrencies: { - return await ws.db - .mktx((x) => [x.auditorTrust, x.exchangeTrust]) - .runReadOnly(async (tx) => { - const trustedAuditors = await tx.auditorTrust.iter().toArray(); - const trustedExchanges = await tx.exchangeTrust.iter().toArray(); - return { - trustedAuditors: trustedAuditors.map((x) => ({ - currency: x.currency, - auditorBaseUrl: x.auditorBaseUrl, - auditorPub: x.auditorPub, - })), - trustedExchanges: trustedExchanges.map((x) => ({ - currency: x.currency, - exchangeBaseUrl: x.exchangeBaseUrl, - exchangeMasterPub: x.exchangeMasterPub, - })), - }; - }); + // FIXME: Remove / change to scoped currency approach. + return { + trustedAuditors: [], + trustedExchanges: [], + }; } case WalletApiOperation.WithdrawFakebank: { const req = codecForWithdrawFakebankRequest().decode(payload); @@ -1780,14 +1762,6 @@ export class Wallet { public static defaultConfig: Readonly = { builtin: { exchanges: ["https://exchange.demo.taler.net/"], - auditors: [ - { - currency: "KUDOS", - auditorPub: "BW9DC48PHQY4NH011SHHX36DZZ3Q22Y6X7FZ1VD1CMZ2PTFZ6PN0", - auditorBaseUrl: "https://auditor.demo.taler.net/", - uids: ["5P25XF8TVQP9AW6VYGY2KV47WT5Y3ZXFSJAA570GJPX5SVJXKBVG"], - }, - ], }, features: { allowHttp: false, @@ -1860,7 +1834,6 @@ class InternalWalletStateImpl implements InternalWalletState { exchangeOps: ExchangeOperations = { getExchangeDetails, - getExchangeTrust, updateExchangeFromUrl, }; -- cgit v1.2.3