aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/util/instructedAmountConversion.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2024-02-19 12:49:17 +0100
committerFlorian Dold <florian@dold.me>2024-02-19 17:47:35 +0100
commit1ec521b9d214b286e747b3ccb3113730ac3a2509 (patch)
tree2f3d2b2906810dca45859b8cbfb8d18d53b27e80 /packages/taler-wallet-core/src/util/instructedAmountConversion.ts
parent1034ecb5f20bd8c75e37e0b4b454ea6c1f4c1da6 (diff)
downloadwallet-core-1ec521b9d214b286e747b3ccb3113730ac3a2509.tar.gz
wallet-core-1ec521b9d214b286e747b3ccb3113730ac3a2509.tar.bz2
wallet-core-1ec521b9d214b286e747b3ccb3113730ac3a2509.zip
wallet-core: simplify/unify DB access
Diffstat (limited to 'packages/taler-wallet-core/src/util/instructedAmountConversion.ts')
-rw-r--r--packages/taler-wallet-core/src/util/instructedAmountConversion.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/util/instructedAmountConversion.ts b/packages/taler-wallet-core/src/util/instructedAmountConversion.ts
index caa3fdca5..c4a2f2d5c 100644
--- a/packages/taler-wallet-core/src/util/instructedAmountConversion.ts
+++ b/packages/taler-wallet-core/src/util/instructedAmountConversion.ts
@@ -139,14 +139,9 @@ async function getAvailableDenoms(
): Promise<AvailableCoins> {
const operationType = getOperationType(TransactionType.Deposit);
- return await ws.db
- .mktx((x) => [
- x.exchanges,
- x.exchangeDetails,
- x.denominations,
- x.coinAvailability,
- ])
- .runReadOnly(async (tx) => {
+ return await ws.db.runReadOnlyTx(
+ ["exchanges", "exchangeDetails", "denominations", "coinAvailability"],
+ async (tx) => {
const list: CoinInfo[] = [];
const exchanges: Record<string, ExchangeInfo> = {};
@@ -304,7 +299,8 @@ async function getAvailableDenoms(
}
return { list, exchanges };
- });
+ },
+ );
}
function buildCoinInfoFromDenom(