summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/refresh.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/refresh.ts')
-rw-r--r--packages/taler-wallet-core/src/refresh.ts22
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/taler-wallet-core/src/refresh.ts b/packages/taler-wallet-core/src/refresh.ts
index f1ee84f3e..cc5eff12c 100644
--- a/packages/taler-wallet-core/src/refresh.ts
+++ b/packages/taler-wallet-core/src/refresh.ts
@@ -99,7 +99,11 @@ import {
constructTransactionIdentifier,
notifyTransition,
} from "./transactions.js";
-import { EXCHANGE_COINS_LOCK, InternalWalletState } from "./wallet.js";
+import {
+ EXCHANGE_COINS_LOCK,
+ getDenomInfo,
+ InternalWalletState,
+} from "./wallet.js";
import { getCandidateWithdrawalDenomsTx } from "./withdraw.js";
const logger = new Logger("refresh.ts");
@@ -378,7 +382,7 @@ async function provideRefreshSession(
const { availableAmount, availableDenoms } = await ws.db.runReadOnlyTx(
["denominations"],
async (tx) => {
- const oldDenom = await ws.getDenomInfo(
+ const oldDenom = await getDenomInfo(
ws,
tx,
exch.exchangeBaseUrl,
@@ -516,7 +520,7 @@ async function refreshMelt(
const oldCoin = await tx.coins.get(refreshGroup.oldCoinPubs[coinIndex]);
checkDbInvariant(!!oldCoin, "melt coin doesn't exist");
- const oldDenom = await ws.getDenomInfo(
+ const oldDenom = await getDenomInfo(
ws,
tx,
oldCoin.exchangeBaseUrl,
@@ -530,7 +534,7 @@ async function refreshMelt(
const newCoinDenoms: RefreshNewDenomInfo[] = [];
for (const dh of refreshSession.newDenoms) {
- const newDenom = await ws.getDenomInfo(
+ const newDenom = await getDenomInfo(
ws,
tx,
oldCoin.exchangeBaseUrl,
@@ -819,7 +823,7 @@ async function refreshReveal(
const oldCoin = await tx.coins.get(refreshGroup.oldCoinPubs[coinIndex]);
checkDbInvariant(!!oldCoin, "melt coin doesn't exist");
- const oldDenom = await ws.getDenomInfo(
+ const oldDenom = await getDenomInfo(
ws,
tx,
oldCoin.exchangeBaseUrl,
@@ -833,7 +837,7 @@ async function refreshReveal(
const newCoinDenoms: RefreshNewDenomInfo[] = [];
for (const dh of refreshSession.newDenoms) {
- const newDenom = await ws.getDenomInfo(
+ const newDenom = await getDenomInfo(
ws,
tx,
oldCoin.exchangeBaseUrl,
@@ -1162,7 +1166,7 @@ export async function calculateRefreshOutput(
for (const ocp of oldCoinPubs) {
const coin = await tx.coins.get(ocp.coinPub);
checkDbInvariant(!!coin, "coin must be in database");
- const denom = await ws.getDenomInfo(
+ const denom = await getDenomInfo(
ws,
tx,
coin.exchangeBaseUrl,
@@ -1210,7 +1214,7 @@ async function applyRefresh(
for (const ocp of oldCoinPubs) {
const coin = await tx.coins.get(ocp.coinPub);
checkDbInvariant(!!coin, "coin must be in database");
- const denom = await ws.getDenomInfo(
+ const denom = await getDenomInfo(
ws,
tx,
coin.exchangeBaseUrl,
@@ -1420,7 +1424,7 @@ export async function forceRefresh(
if (!coin) {
throw Error(`coin (pubkey ${c}) not found`);
}
- const denom = await ws.getDenomInfo(
+ const denom = await getDenomInfo(
ws,
tx,
coin.exchangeBaseUrl,