diff options
author | Florian Dold <florian@dold.me> | 2021-06-02 13:23:51 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-06-02 13:24:28 +0200 |
commit | 02f1d4b08116c24f0af1f32cb6d82be292fa6d10 (patch) | |
tree | 1fbcc1675e09584a74896909e1d4d0882d10be8e /packages/taler-wallet-core/src/operations/currencies.ts | |
parent | c6c17a1c0aaa2c76616ec93df3ebe6621b547cd9 (diff) | |
download | wallet-core-02f1d4b08116c24f0af1f32cb6d82be292fa6d10.tar.xz |
support multiple exchange details per base URL
Diffstat (limited to 'packages/taler-wallet-core/src/operations/currencies.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/currencies.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/operations/currencies.ts b/packages/taler-wallet-core/src/operations/currencies.ts index 1af30dfb5..5371d4a54 100644 --- a/packages/taler-wallet-core/src/operations/currencies.ts +++ b/packages/taler-wallet-core/src/operations/currencies.ts @@ -19,6 +19,7 @@ */ import { ExchangeRecord, Stores } from "../db.js"; import { Logger } from "../index.js"; +import { getExchangeDetails } from "./exchanges.js"; import { InternalWalletState } from "./state.js"; const logger = new Logger("currencies.ts"); @@ -37,7 +38,12 @@ export async function getExchangeTrust( ): Promise<TrustInfo> { let isTrusted = false; let isAudited = false; - const exchangeDetails = exchangeInfo.details; + const exchangeDetails = await ws.db.runWithReadTransaction( + [Stores.exchangeDetails, Stores.exchanges], + async (tx) => { + return getExchangeDetails(tx, exchangeInfo.baseUrl); + }, + ); if (!exchangeDetails) { throw Error(`exchange ${exchangeInfo.baseUrl} details not available`); } |