diff options
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts')
-rw-r--r-- | packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts b/packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts index 2aceab86e..e3e18d5a4 100644 --- a/packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts +++ b/packages/taler-harness/src/integrationtests/test-wallet-backup-doublespend.ts @@ -21,21 +21,22 @@ import { PreparePayResultType } from "@gnu-taler/taler-util"; import { WalletApiOperation } from "@gnu-taler/taler-wallet-core"; import { GlobalTestState, - WalletCli, MerchantPrivateApi, + WalletCli, } from "../harness/harness.js"; import { - createSimpleTestkudosEnvironment, - makeTestPayment, + createSimpleTestkudosEnvironmentV2, + makeTestPaymentV2, withdrawViaBank, + withdrawViaBankV2 } from "../harness/helpers.js"; import { SyncService } from "../harness/sync.js"; export async function runWalletBackupDoublespendTest(t: GlobalTestState) { // Set up test environment - const { commonDb, merchant, wallet, bank, exchange } = - await createSimpleTestkudosEnvironment(t); + const { commonDb, merchant, walletClient, bank, exchange } = + await createSimpleTestkudosEnvironmentV2(t); const sync = await SyncService.create(t, { currency: "TESTKUDOS", @@ -51,21 +52,21 @@ export async function runWalletBackupDoublespendTest(t: GlobalTestState) { await sync.start(); await sync.pingUntilAvailable(); - await wallet.client.call(WalletApiOperation.AddBackupProvider, { + await walletClient.call(WalletApiOperation.AddBackupProvider, { backupProviderBaseUrl: sync.baseUrl, activate: true, name: sync.baseUrl, }); - await withdrawViaBank(t, { wallet, bank, exchange, amount: "TESTKUDOS:10" }); + await withdrawViaBankV2(t, { walletClient, bank, exchange, amount: "TESTKUDOS:10" }); - await wallet.runUntilDone(); + await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); - await wallet.client.call(WalletApiOperation.RunBackupCycle, {}); - await wallet.runUntilDone(); - await wallet.client.call(WalletApiOperation.RunBackupCycle, {}); + await walletClient.call(WalletApiOperation.RunBackupCycle, {}); + await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); + await walletClient.call(WalletApiOperation.RunBackupCycle, {}); - const backupRecovery = await wallet.client.call( + const backupRecovery = await walletClient.call( WalletApiOperation.ExportBackupRecovery, {}, ); @@ -80,23 +81,23 @@ export async function runWalletBackupDoublespendTest(t: GlobalTestState) { console.log( "wallet1 balance before spend:", - await wallet.client.call(WalletApiOperation.GetBalances, {}), + await walletClient.call(WalletApiOperation.GetBalances, {}), ); - await makeTestPayment(t, { + await makeTestPaymentV2(t, { merchant, - wallet, + walletClient, order: { summary: "foo", amount: "TESTKUDOS:7", }, }); - await wallet.runUntilDone(); + await walletClient.call(WalletApiOperation.TestingWaitTransactionsFinal, {}); console.log( "wallet1 balance after spend:", - await wallet.client.call(WalletApiOperation.GetBalances, {}), + await walletClient.call(WalletApiOperation.GetBalances, {}), ); { |