diff options
author | Florian Dold <florian@dold.me> | 2023-09-05 10:46:06 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-09-05 10:48:41 +0200 |
commit | a60a1d867cfe6a12f1e6fadfa037f022e9385107 (patch) | |
tree | bc77a92b327cd0e4933fa4b3fe15f1c775e24235 /packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts | |
parent | e1d86816a7c07cb8ca2d54676d5cdbbe513f2ba7 (diff) | |
download | wallet-core-a60a1d867cfe6a12f1e6fadfa037f022e9385107.tar.xz |
harness: remove deprecated testing APIs
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts b/packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts index 5321cf5c7..21ac662c2 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-backup-basic.ts @@ -21,9 +21,8 @@ import { j2s } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, WalletCli } from "../harness/harness.js"; import { - createSimpleTestkudosEnvironment, createSimpleTestkudosEnvironmentV2, - withdrawViaBank, + createWalletDaemonWithClient, withdrawViaBankV2, } from "../harness/helpers.js"; import { SyncService } from "../harness/sync.js"; @@ -112,40 +111,42 @@ export async function runWalletBackupBasicTest(t: GlobalTestState) { const txs = await walletClient.call(WalletApiOperation.GetTransactions, {}); console.log(`backed up transactions ${j2s(txs)}`); - const wallet2 = new WalletCli(t, "wallet2"); + const { walletClient: walletClient2 } = await createWalletDaemonWithClient(t, { + name: "w2" + }); // Check that the second wallet is a fresh wallet. { - const bal = await wallet2.client.call(WalletApiOperation.GetBalances, {}); + const bal = await walletClient2.call(WalletApiOperation.GetBalances, {}); t.assertTrue(bal.balances.length === 0); } - await wallet2.client.call(WalletApiOperation.ImportBackupRecovery, { + await walletClient2.call(WalletApiOperation.ImportBackupRecovery, { recovery: backupRecovery, }); - await wallet2.client.call(WalletApiOperation.RunBackupCycle, {}); + await walletClient2.call(WalletApiOperation.RunBackupCycle, {}); // Check that now the old balance is available! { - const bal = await wallet2.client.call(WalletApiOperation.GetBalances, {}); + const bal = await walletClient2.call(WalletApiOperation.GetBalances, {}); t.assertTrue(bal.balances.length === 1); console.log(bal); } // Now do some basic checks that the restored wallet is still functional { - const txs = await wallet2.client.call( + const txs = await walletClient2.call( WalletApiOperation.GetTransactions, {}, ); console.log(`restored transactions ${j2s(txs)}`); - const bal1 = await wallet2.client.call(WalletApiOperation.GetBalances, {}); + const bal1 = await walletClient2.call(WalletApiOperation.GetBalances, {}); t.assertAmountEquals(bal1.balances[0].available, "TESTKUDOS:14.1"); - await withdrawViaBank(t, { - wallet: wallet2, + await withdrawViaBankV2(t, { + walletClient: walletClient2, bank, exchange, amount: "TESTKUDOS:10", @@ -153,15 +154,15 @@ export async function runWalletBackupBasicTest(t: GlobalTestState) { await exchange.runWirewatchOnce(); - await wallet2.runUntilDone(); + await walletClient2.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - const txs2 = await wallet2.client.call( + const txs2 = await walletClient2.call( WalletApiOperation.GetTransactions, {}, ); console.log(`tx after withdraw after restore ${j2s(txs2)}`); - const bal2 = await wallet2.client.call(WalletApiOperation.GetBalances, {}); + const bal2 = await walletClient2.call(WalletApiOperation.GetBalances, {}); t.assertAmountEquals(bal2.balances[0].available, "TESTKUDOS:23.82"); } |