Skip to content

Commit

Permalink
tests: fix TestAccountsCanSendMoney more (algorand#4374)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasguoalgorand authored Aug 9, 2022
1 parent d7ed271 commit 49086e8
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions test/e2e-go/features/transactions/sendReceive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,24 +139,25 @@ func testAccountsCanSendMoney(t *testing.T, templatePath string, numberOfSends i
curStatus, _ := pongClient.Status()
curRound := curStatus.LastRound

if waitForTransaction {
fixture.AlgodClient = fixture.GetAlgodClientForController(fixture.GetNodeControllerForDataDir(pongClient.DataDir()))
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pingTxidsToAddresses)
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pongTxidsToAddresses)
}
fixture.AlgodClient = fixture.GetAlgodClientForController(fixture.GetNodeControllerForDataDir(pongClient.DataDir()))
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pingTxidsToAddresses)
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pongTxidsToAddresses)

pingBalance, _ = fixture.GetBalanceAndRound(pingAccount)
pongBalance, _ = fixture.GetBalanceAndRound(pongAccount)
pingBalance, err = pongClient.GetBalance(pingAccount)
a.NoError(err)
pongBalance, err = pongClient.GetBalance(pongAccount)
a.NoError(err)
a.True(expectedPingBalance <= pingBalance, "ping balance is different than expected.")
a.True(expectedPongBalance <= pongBalance, "pong balance is different than expected.")

if waitForTransaction {
fixture.AlgodClient = fixture.GetAlgodClientForController(fixture.GetNodeControllerForDataDir(pingClient.DataDir()))
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pongTxidsToAddresses)
}
fixture.AlgodClient = fixture.GetAlgodClientForController(fixture.GetNodeControllerForDataDir(pingClient.DataDir()))
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pingTxidsToAddresses)
fixture.WaitForAllTxnsToConfirm(curRound+uint64(5), pongTxidsToAddresses)

pingBalance, _ = fixture.GetBalanceAndRound(pingAccount)
pongBalance, _ = fixture.GetBalanceAndRound(pongAccount)
pingBalance, err = pingClient.GetBalance(pingAccount)
a.NoError(err)
pongBalance, err = pingClient.GetBalance(pongAccount)
a.NoError(err)
a.True(expectedPingBalance <= pingBalance, "ping balance is different than expected.")
a.True(expectedPongBalance <= pongBalance, "pong balance is different than expected.")
}

0 comments on commit 49086e8

Please sign in to comment.