summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/currencies.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-02 13:23:51 +0200
committerFlorian Dold <florian@dold.me>2021-06-02 13:24:28 +0200
commit02f1d4b08116c24f0af1f32cb6d82be292fa6d10 (patch)
tree1fbcc1675e09584a74896909e1d4d0882d10be8e /packages/taler-wallet-core/src/operations/currencies.ts
parentc6c17a1c0aaa2c76616ec93df3ebe6621b547cd9 (diff)
downloadwallet-core-02f1d4b08116c24f0af1f32cb6d82be292fa6d10.tar.gz
wallet-core-02f1d4b08116c24f0af1f32cb6d82be292fa6d10.tar.bz2
wallet-core-02f1d4b08116c24f0af1f32cb6d82be292fa6d10.zip
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.ts8
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`);
}