taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 272c8884bbd56f1ec8ac0091c3e2537a8cebd427
parent c1fce2a921e84612ddb9cde7c9a50b3c627b9a8f
Author: Florian Dold <florian@dold.me>
Date:   Fri, 28 Nov 2025 10:49:32 +0100

harness: extend test for deposit with high fees

Diffstat:
Mpackages/taler-harness/src/integrationtests/test-deposit.ts | 59+++++++++++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 51 insertions(+), 8 deletions(-)

diff --git a/packages/taler-harness/src/integrationtests/test-deposit.ts b/packages/taler-harness/src/integrationtests/test-deposit.ts @@ -44,14 +44,15 @@ export async function runDepositTest(t: GlobalTestState) { // Withdraw digital cash into the wallet. - const withdrawalResult = await withdrawViaBankV3(t, { - walletClient, - bankClient, - exchange, - amount: "TESTKUDOS:20", - }); - - await withdrawalResult.withdrawalFinishedCond; + { + const withdrawalResult = await withdrawViaBankV3(t, { + walletClient, + bankClient, + exchange, + amount: "TESTKUDOS:20", + }); + await withdrawalResult.withdrawalFinishedCond; + } const depositPaytoUri = getTestHarnessPaytoForLabel("foo"); @@ -132,6 +133,48 @@ export async function runDepositTest(t: GlobalTestState) { const balAfter = await walletClient.call(WalletApiOperation.GetBalances, {}); console.log(`balances after deposit: ${j2s(balAfter)}`); t.assertAmountEquals(balAfter.balances[0].pendingOutgoing, "TESTKUDOS:0"); + + // Now, test tiny deposits where fees eat the amount! + + { + const withdrawalResult = await withdrawViaBankV3(t, { + walletClient, + bankClient, + exchange, + amount: "TESTKUDOS:5", + }); + await withdrawalResult.withdrawalFinishedCond; + } + + { + const amt = "TESTKUDOS:0.01" as AmountString; + const res = await walletClient.call(WalletApiOperation.CheckDeposit, { + amount: amt, + depositPaytoUri, + }); + console.log(`check res: ${j2s(res)}`); + const depositGroupResult = await walletClient.client.call( + WalletApiOperation.CreateDepositGroup, + { + amount: amt, + depositPaytoUri, + }, + ); + + console.log(`create result:`); + console.log(j2s(depositGroupResult)); + + const transactions = await walletClient.call( + WalletApiOperation.GetTransactionsV2, + {}, + ); + console.log(j2s(transactions)); + t.assertTrue( + transactions.transactions.find( + (x) => x.transactionId === depositGroupResult.transactionId, + ) != null, + ); + } } runDepositTest.suites = ["wallet"];