[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: harness: fix test-peer-repair
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: harness: fix test-peer-repair |
Date: |
Tue, 20 Jun 2023 16:20:00 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 1f60ac76f harness: fix test-peer-repair
1f60ac76f is described below
commit 1f60ac76f920da9c710c4a6116741f4412350f4a
Author: Florian Dold <florian@dold.me>
AuthorDate: Tue Jun 20 16:19:53 2023 +0200
harness: fix test-peer-repair
---
.../src/integrationtests/test-peer-repair.ts | 45 +++++++++++++++++-----
1 file changed, 35 insertions(+), 10 deletions(-)
diff --git a/packages/taler-harness/src/integrationtests/test-peer-repair.ts
b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
index cfa7ec877..b09bff2dc 100644
--- a/packages/taler-harness/src/integrationtests/test-peer-repair.ts
+++ b/packages/taler-harness/src/integrationtests/test-peer-repair.ts
@@ -61,7 +61,8 @@ export async function runPeerRepairTest(t: GlobalTestState) {
const wallet2 = w2.walletClient;
const withdrawalDoneCond = wallet1.waitForNotificationCond(
- (x) => x.type === NotificationType.TransactionStateTransition &&
+ (x) =>
+ x.type === NotificationType.TransactionStateTransition &&
x.newTxState.major === TransactionMajorState.Done &&
x.transactionId.startsWith("txn:withdrawal:"),
);
@@ -102,7 +103,7 @@ export async function runPeerRepairTest(t: GlobalTestState)
{
x.type === NotificationType.TransactionStateTransition &&
x.transactionId === resp1.transactionId &&
x.newTxState.major === TransactionMajorState.Pending &&
- x.newTxState.minor === TransactionMinorState.Ready
+ x.newTxState.minor === TransactionMinorState.Ready,
);
await peerPushDebitReady1Cond;
@@ -128,12 +129,9 @@ export async function runPeerRepairTest(t:
GlobalTestState) {
x.newTxState.major === TransactionMajorState.Done,
);
- await wallet2.client.call(
- WalletApiOperation.ConfirmPeerPushCredit,
- {
- peerPushPaymentIncomingId: resp2.peerPushPaymentIncomingId,
- },
- );
+ await wallet2.client.call(WalletApiOperation.ConfirmPeerPushCredit, {
+ peerPushPaymentIncomingId: resp2.peerPushPaymentIncomingId,
+ });
await peerPushCreditDone1Cond;
await peerPushDebitDone1Cond;
@@ -154,6 +152,8 @@ export async function runPeerRepairTest(t: GlobalTestState)
{
});
wallet1 = w1.walletClient;
+ console.log("attempting peer-push-debit, should fail.");
+
const initResp2 = await wallet1.client.call(
WalletApiOperation.InitiatePeerPushDebit,
{
@@ -166,12 +166,37 @@ export async function runPeerRepairTest(t:
GlobalTestState) {
},
);
+ const peerPushDebitFailingCond = wallet1.waitForNotificationCond(
+ (x) =>
+ x.type === NotificationType.TransactionStateTransition &&
+ x.transactionId === initResp2.transactionId &&
+ x.newTxState.major === TransactionMajorState.Pending &&
+ x.errorInfo != null,
+ );
+
+ console.log(`waiting for error on ${initResp2.transactionId}`);
+
+ await peerPushDebitFailingCond;
+
+ console.log("reached error");
+
+ // Now withdraw so we have enough coins to re-select
+
+ const withdraw2Res = await withdrawViaBankV2(t, {
+ walletClient: wallet1,
+ bank,
+ exchange,
+ amount: "TESTKUDOS:5",
+ });
+
+ await withdraw2Res.withdrawalFinishedCond;
+
const peerPushDebitReady2Cond = wallet1.waitForNotificationCond(
(x) =>
x.type === NotificationType.TransactionStateTransition &&
- x.transactionId === resp1.transactionId &&
+ x.transactionId === initResp2.transactionId &&
x.newTxState.major === TransactionMajorState.Pending &&
- x.newTxState.minor === TransactionMinorState.Ready
+ x.newTxState.minor === TransactionMinorState.Ready,
);
await peerPushDebitReady2Cond;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: harness: fix test-peer-repair,
gnunet <=