aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2023-06-19 16:02:23 +0200
committerFlorian Dold <florian@dold.me>2023-06-19 16:02:23 +0200
commitffa68ce8ddc77bf622af4234696a065cde482554 (patch)
treee97dda150c3a2914e288ce32416c97e36de45d77 /packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
parentbcff03949b40d0d37069bdb7af941061e367a093 (diff)
downloadwallet-core-ffa68ce8ddc77bf622af4234696a065cde482554.tar.xz
taler-harness: WIP integration test for p2p coin selection repair
Diffstat (limited to 'packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts')
-rw-r--r--packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts16
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts b/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
index 1e33afa34..aed3fe8db 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-to-peer-pull.ts
@@ -22,15 +22,14 @@ import {
Duration,
j2s,
NotificationType,
+ TransactionMajorState,
WalletNotification,
} from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { GlobalTestState, WalletCli } from "../harness/harness.js";
+import { GlobalTestState } from "../harness/harness.js";
import {
- createSimpleTestkudosEnvironment,
createSimpleTestkudosEnvironmentV2,
createWalletDaemonWithClient,
- withdrawViaBank,
withdrawViaBankV2,
} from "../harness/helpers.js";
@@ -106,7 +105,15 @@ export async function runPeerToPeerPullTest(t: GlobalTestState) {
// FIXME: The wallet should emit a more appropriate notification here.
// Yes, it's technically a withdrawal.
const peerPullCreditDoneCond = wallet1.waitForNotificationCond(
- (x) => x.type === NotificationType.WithdrawGroupFinished,
+ (x) => x.type === NotificationType.TransactionStateTransition &&
+ x.transactionId === resp.transactionId &&
+ x.newTxState.major === TransactionMajorState.Done,
+ );
+
+ const peerPullDebitDoneCond = wallet2.waitForNotificationCond(
+ (x) => x.type === NotificationType.TransactionStateTransition &&
+ x.transactionId === checkResp.transactionId &&
+ x.newTxState.major === TransactionMajorState.Done,
);
await wallet2.client.call(WalletApiOperation.ConfirmPeerPullDebit, {
@@ -114,6 +121,7 @@ export async function runPeerToPeerPullTest(t: GlobalTestState) {
});
await peerPullCreditDoneCond;
+ await peerPullDebitDoneCond;
const txn1 = await wallet1.client.call(
WalletApiOperation.GetTransactions,