From f9bca89502da70ef0fdc9b0e130ea50cdff72a0e Mon Sep 17 00:00:00 2001 From: Nicholas Guo Date: Mon, 29 Aug 2022 09:43:31 -0700 Subject: [PATCH 1/4] fix --- test/framework/fixtures/restClientFixture.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/framework/fixtures/restClientFixture.go b/test/framework/fixtures/restClientFixture.go index f77e786c87..87c38b32db 100644 --- a/test/framework/fixtures/restClientFixture.go +++ b/test/framework/fixtures/restClientFixture.go @@ -18,6 +18,7 @@ package fixtures import ( "fmt" + "github.com/algorand/go-algorand/data/basics" "sort" "time" "unicode" @@ -328,7 +329,7 @@ func (f *RestClientFixture) SendMoneyAndWait(curRound, amountToSend, transaction // SendMoneyAndWaitFromWallet is as above, but for a specific wallet func (f *RestClientFixture) SendMoneyAndWaitFromWallet(walletHandle, walletPassword []byte, curRound, amountToSend, transactionFee uint64, fromAccount, toAccount string, closeToAccount string) (txn v1.Transaction) { client := f.LibGoalClient - fundingTx, err := client.SendPaymentFromWallet(walletHandle, walletPassword, fromAccount, toAccount, transactionFee, amountToSend, nil, closeToAccount, 0, 0) + fundingTx, err := client.SendPaymentFromWallet(walletHandle, walletPassword, fromAccount, toAccount, transactionFee, amountToSend, nil, closeToAccount, basics.Round(curRound).SubSaturate(1), basics.Round(curRound+1000)) require.NoError(f.t, err, "client should be able to send money from rich to poor account") require.NotEmpty(f.t, fundingTx.ID().String(), "transaction ID should not be empty") waitingDeadline := curRound + uint64(5) From 308de4b37b5c3eb7387c188f7b2041fe3154259a Mon Sep 17 00:00:00 2001 From: Nicholas Guo Date: Mon, 29 Aug 2022 11:44:11 -0700 Subject: [PATCH 2/4] change last valid --- test/framework/fixtures/restClientFixture.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/framework/fixtures/restClientFixture.go b/test/framework/fixtures/restClientFixture.go index 87c38b32db..e697bf6d2f 100644 --- a/test/framework/fixtures/restClientFixture.go +++ b/test/framework/fixtures/restClientFixture.go @@ -329,7 +329,7 @@ func (f *RestClientFixture) SendMoneyAndWait(curRound, amountToSend, transaction // SendMoneyAndWaitFromWallet is as above, but for a specific wallet func (f *RestClientFixture) SendMoneyAndWaitFromWallet(walletHandle, walletPassword []byte, curRound, amountToSend, transactionFee uint64, fromAccount, toAccount string, closeToAccount string) (txn v1.Transaction) { client := f.LibGoalClient - fundingTx, err := client.SendPaymentFromWallet(walletHandle, walletPassword, fromAccount, toAccount, transactionFee, amountToSend, nil, closeToAccount, basics.Round(curRound).SubSaturate(1), basics.Round(curRound+1000)) + fundingTx, err := client.SendPaymentFromWallet(walletHandle, walletPassword, fromAccount, toAccount, transactionFee, amountToSend, nil, closeToAccount, basics.Round(curRound).SubSaturate(1), 0) require.NoError(f.t, err, "client should be able to send money from rich to poor account") require.NotEmpty(f.t, fundingTx.ID().String(), "transaction ID should not be empty") waitingDeadline := curRound + uint64(5) From 992977027bc13f13b1afb8f3dee1196527e8fc49 Mon Sep 17 00:00:00 2001 From: Nicholas Guo Date: Mon, 29 Aug 2022 12:31:03 -0700 Subject: [PATCH 3/4] fix test --- .../e2e-go/features/participation/participationRewards_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/e2e-go/features/participation/participationRewards_test.go b/test/e2e-go/features/participation/participationRewards_test.go index a7dd6452e4..7c03686668 100644 --- a/test/e2e-go/features/participation/participationRewards_test.go +++ b/test/e2e-go/features/participation/participationRewards_test.go @@ -347,8 +347,7 @@ func TestRewardRateRecalculation(t *testing.T) { r.NoError(err) minFee, minBal, err := fixture.MinFeeAndBalance(curStatus.LastRound) r.NoError(err) - deadline := curStatus.LastRound + uint64(5) - fixture.SendMoneyAndWait(deadline, amountToSend, minFee, richAccount.Address, rewardsAccount, "") + fixture.SendMoneyAndWait(curStatus.LastRound, amountToSend, minFee, richAccount.Address, rewardsAccount, "") blk, err := client.Block(curStatus.LastRound) r.NoError(err) From db21d2435be71cd5a7f79e880ba2beaa6a3873f7 Mon Sep 17 00:00:00 2001 From: Nicholas Guo Date: Mon, 29 Aug 2022 12:47:28 -0700 Subject: [PATCH 4/4] fix --- .../e2e-go/features/participation/participationRewards_test.go | 3 +-- test/framework/fixtures/restClientFixture.go | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e-go/features/participation/participationRewards_test.go b/test/e2e-go/features/participation/participationRewards_test.go index 7c03686668..3c8a293714 100644 --- a/test/e2e-go/features/participation/participationRewards_test.go +++ b/test/e2e-go/features/participation/participationRewards_test.go @@ -372,8 +372,7 @@ func TestRewardRateRecalculation(t *testing.T) { curStatus, err = client.Status() r.NoError(err) - deadline = curStatus.LastRound + uint64(5) - fixture.SendMoneyAndWait(deadline, amountToSend, minFee, richAccount.Address, rewardsAccount, "") + fixture.SendMoneyAndWait(curStatus.LastRound, amountToSend, minFee, richAccount.Address, rewardsAccount, "") rewardRecalcRound = rewardRecalcRound + consensusParams.RewardsRateRefreshInterval diff --git a/test/framework/fixtures/restClientFixture.go b/test/framework/fixtures/restClientFixture.go index e697bf6d2f..c9f3befa84 100644 --- a/test/framework/fixtures/restClientFixture.go +++ b/test/framework/fixtures/restClientFixture.go @@ -329,6 +329,7 @@ func (f *RestClientFixture) SendMoneyAndWait(curRound, amountToSend, transaction // SendMoneyAndWaitFromWallet is as above, but for a specific wallet func (f *RestClientFixture) SendMoneyAndWaitFromWallet(walletHandle, walletPassword []byte, curRound, amountToSend, transactionFee uint64, fromAccount, toAccount string, closeToAccount string) (txn v1.Transaction) { client := f.LibGoalClient + // use one curRound - 1 in case other nodes are behind fundingTx, err := client.SendPaymentFromWallet(walletHandle, walletPassword, fromAccount, toAccount, transactionFee, amountToSend, nil, closeToAccount, basics.Round(curRound).SubSaturate(1), 0) require.NoError(f.t, err, "client should be able to send money from rich to poor account") require.NotEmpty(f.t, fundingTx.ID().String(), "transaction ID should not be empty")