diff options
author | Sebastian <sebasjm@gmail.com> | 2024-06-12 12:38:28 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-06-12 12:38:28 -0300 |
commit | f9d4ff5b43e48a07ac81d7e7ef800ddb12f5f90a (patch) | |
tree | 066d37ecc36ab9085e59411f6b69a75c43cd5577 /packages/taler-wallet-core/src/pay-peer-push-credit.ts | |
parent | 366b2e6d8bdaab0995ce43e8f56edb3600ab7c01 (diff) | |
download | wallet-core-f9d4ff5b43e48a07ac81d7e7ef800ddb12f5f90a.tar.xz |
do not throw error when asking withdrawal info for instructed amount 0
Diffstat (limited to 'packages/taler-wallet-core/src/pay-peer-push-credit.ts')
-rw-r--r-- | packages/taler-wallet-core/src/pay-peer-push-credit.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/pay-peer-push-credit.ts b/packages/taler-wallet-core/src/pay-peer-push-credit.ts index ae2372eeb..5a1bfbdbd 100644 --- a/packages/taler-wallet-core/src/pay-peer-push-credit.ts +++ b/packages/taler-wallet-core/src/pay-peer-push-credit.ts @@ -461,6 +461,12 @@ export async function preparePeerPushCredit( undefined, ); + if (wi.selectedDenoms.selectedDenoms.length === 0) { + throw Error( + `unable to prepare push credit from ${exchangeBaseUrl}, can't select denominations for instructed amount (${purseStatus.balance}`, + ); + } + const transitionInfo = await wex.db.runReadWriteTx( { storeNames: ["contractTerms", "peerPushCredit"] }, async (tx) => { |