diff options
author | Pavel Zbitskiy <65323360+algorandskiy@users.noreply.github.com> | 2022-08-09 12:19:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-09 12:19:10 -0400 |
commit | 9a03260c8bf1824dbe8a9ca62d93e751939cb95e (patch) | |
tree | 4e848fb03edb3c9b82a0d35e952276bc58bc8818 | |
parent | 566be49a6e76816b392058a7f27c4ffca296a877 (diff) |
tests: fix TestAssetValidRounds (#4351)algobarb/9a03260
* The test validates first/last valid against possible expired value of lastRound.
Make ComputeValidityRounds returning lastValid to check validity range against it.
* Fix some linter warnings
* Modify all usages of ComputeValidityRounds
* expect: fix global vars usage in TCL when dumping nodes logs on error
-rw-r--r-- | cmd/goal/account.go | 4 | ||||
-rw-r--r-- | cmd/goal/application.go | 16 | ||||
-rw-r--r-- | cmd/goal/asset.go | 12 | ||||
-rw-r--r-- | cmd/goal/clerk.go | 2 | ||||
-rw-r--r-- | cmd/goal/interact.go | 2 | ||||
-rw-r--r-- | libgoal/libgoal.go | 9 | ||||
-rw-r--r-- | test/e2e-go/cli/goal/expect/goalExpectCommon.exp | 14 | ||||
-rw-r--r-- | test/e2e-go/features/transactions/application_test.go | 5 | ||||
-rw-r--r-- | test/e2e-go/features/transactions/asset_test.go | 38 | ||||
-rw-r--r-- | test/e2e-go/features/transactions/onlineStatusChange_test.go | 3 | ||||
-rw-r--r-- | test/e2e-go/features/transactions/sendReceive_test.go | 2 |
11 files changed, 58 insertions, 49 deletions
diff --git a/cmd/goal/account.go b/cmd/goal/account.go index 45cfafada..6cd3b9a87 100644 --- a/cmd/goal/account.go +++ b/cmd/goal/account.go @@ -819,7 +819,7 @@ var changeOnlineCmd = &cobra.Command{ } } - firstTxRound, lastTxRound, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstTxRound, lastTxRound, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf(err.Error()) } @@ -1430,7 +1430,7 @@ var markNonparticipatingCmd = &cobra.Command{ dataDir := ensureSingleDataDir() client := ensureFullClient(dataDir) - firstTxRound, lastTxRound, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstTxRound, lastTxRound, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf(errorConstructingTX, err) } diff --git a/cmd/goal/application.go b/cmd/goal/application.go index 66532647d..884c3d6e6 100644 --- a/cmd/goal/application.go +++ b/cmd/goal/application.go @@ -461,7 +461,7 @@ var createAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -536,7 +536,7 @@ var updateAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -606,7 +606,7 @@ var optInAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -676,7 +676,7 @@ var closeOutAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -746,7 +746,7 @@ var clearAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -816,7 +816,7 @@ var callAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -886,7 +886,7 @@ var deleteAppCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -1307,7 +1307,7 @@ var methodAppCmd = &cobra.Command{ appCallTxn.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } diff --git a/cmd/goal/asset.go b/cmd/goal/asset.go index acfb0a732..5826fd083 100644 --- a/cmd/goal/asset.go +++ b/cmd/goal/asset.go @@ -283,7 +283,7 @@ var createAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -362,7 +362,7 @@ var destroyAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -455,7 +455,7 @@ var configAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -540,7 +540,7 @@ var sendAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -611,7 +611,7 @@ var freezeAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } @@ -698,7 +698,7 @@ var optinAssetCmd = &cobra.Command{ tx.Note = parseNoteField(cmd) tx.Lease = parseLease(cmd) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } diff --git a/cmd/goal/clerk.go b/cmd/goal/clerk.go index 856662147..2be5ff332 100644 --- a/cmd/goal/clerk.go +++ b/cmd/goal/clerk.go @@ -384,7 +384,7 @@ var sendCmd = &cobra.Command{ } } client := ensureFullClient(dataDir) - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf(err.Error()) } diff --git a/cmd/goal/interact.go b/cmd/goal/interact.go index ffa66b5ca..45fb5bf8a 100644 --- a/cmd/goal/interact.go +++ b/cmd/goal/interact.go @@ -596,7 +596,7 @@ var appExecuteCmd = &cobra.Command{ tx.Lease = parseLease(cmd) // Fill in rounds, fee, etc. - fv, lv, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) + fv, lv, _, err := client.ComputeValidityRounds(firstValid, lastValid, numValidRounds) if err != nil { reportErrorf("Cannot determine last valid round: %s", err) } diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go index 6aed7f075..562ec0fe1 100644 --- a/libgoal/libgoal.go +++ b/libgoal/libgoal.go @@ -513,17 +513,18 @@ func (c *Client) signAndBroadcastTransactionWithWallet(walletHandle, pw []byte, // M | 0 | first + validRounds - 1 // M | M | error // -func (c *Client) ComputeValidityRounds(firstValid, lastValid, validRounds uint64) (uint64, uint64, error) { +func (c *Client) ComputeValidityRounds(firstValid, lastValid, validRounds uint64) (first, last, latest uint64, err error) { params, err := c.SuggestedParams() if err != nil { - return 0, 0, err + return 0, 0, 0, err } cparams, ok := c.consensus[protocol.ConsensusVersion(params.ConsensusVersion)] if !ok { - return 0, 0, fmt.Errorf("cannot construct transaction: unknown consensus protocol %s", params.ConsensusVersion) + return 0, 0, 0, fmt.Errorf("cannot construct transaction: unknown consensus protocol %s", params.ConsensusVersion) } - return computeValidityRounds(firstValid, lastValid, validRounds, params.LastRound, cparams.MaxTxnLife) + first, last, err = computeValidityRounds(firstValid, lastValid, validRounds, params.LastRound, cparams.MaxTxnLife) + return first, last, params.LastRound, err } func computeValidityRounds(firstValid, lastValid, validRounds, lastRound, maxTxnLife uint64) (uint64, uint64, error) { diff --git a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp index 976ab73d0..f528dabb1 100644 --- a/test/e2e-go/cli/goal/expect/goalExpectCommon.exp +++ b/test/e2e-go/cli/goal/expect/goalExpectCommon.exp @@ -52,7 +52,7 @@ proc ::AlgorandGoal::Abort { ERROR } { puts "GLOBAL_NETWORK_NAME $::GLOBAL_NETWORK_NAME" log_user 1 - set NODE_DATA_DIR $GLOBAL_TEST_ROOT_DIR/Primary + set NODE_DATA_DIR $::GLOBAL_TEST_ROOT_DIR/Primary if { [info exists ::NODE_DATA_DIR] } { set outLog [exec cat $NODE_DATA_DIR/algod-out.log] puts "$NODE_DATA_DIR/algod-out.log :\r\n$outLog" @@ -61,7 +61,7 @@ proc ::AlgorandGoal::Abort { ERROR } { set nodeLog [exec -- tail -n 30 $NODE_DATA_DIR/node.log] puts "$NODE_DATA_DIR/node.log :\r\n$nodeLog" } - set NODE_DATA_DIR $GLOBAL_TEST_ROOT_DIR/Node + set NODE_DATA_DIR $::GLOBAL_TEST_ROOT_DIR/Node if { [info exists ::NODE_DATA_DIR] } { set outLog [exec cat $NODE_DATA_DIR/algod-out.log] puts "$NODE_DATA_DIR/algod-out.log :\r\n$outLog" @@ -78,12 +78,12 @@ proc ::AlgorandGoal::Abort { ERROR } { puts "GLOBAL_TEST_ALGO_DIR $::GLOBAL_TEST_ALGO_DIR" log_user 1 - set outLog [exec cat $GLOBAL_TEST_ALGO_DIR/algod-out.log] - puts "$GLOBAL_TEST_ALGO_DIR/algod-out.log :\r\n$outLog" - set errLog [exec cat $GLOBAL_TEST_ALGO_DIR/algod-err.log] + set outLog [exec cat $::GLOBAL_TEST_ALGO_DIR/algod-out.log] + puts "$::GLOBAL_TEST_ALGO_DIR/algod-out.log :\r\n$outLog" + set errLog [exec cat $::GLOBAL_TEST_ALGO_DIR/algod-err.log] puts "$NODE_DATA_DIR/algod-err.log :\r\n$errLog" - set nodeLog [exec -- tail -n 30 $GLOBAL_TEST_ALGO_DIR/node.log] - puts "$GLOBAL_TEST_ALGO_DIR/node.log :\r\n$nodeLog" + set nodeLog [exec -- tail -n 30 $::GLOBAL_TEST_ALGO_DIR/node.log] + puts "$::GLOBAL_TEST_ALGO_DIR/node.log :\r\n$nodeLog" ::AlgorandGoal::StopNode $::GLOBAL_TEST_ALGO_DIR } diff --git a/test/e2e-go/features/transactions/application_test.go b/test/e2e-go/features/transactions/application_test.go index c9a4ac131..a5786cc4f 100644 --- a/test/e2e-go/features/transactions/application_test.go +++ b/test/e2e-go/features/transactions/application_test.go @@ -66,7 +66,7 @@ func TestApplication(t *testing.T) { a.NoError(err) creator := accountList[0].Address - wh, err := client.GetUnencryptedWalletHandle() + _, err = client.GetUnencryptedWalletHandle() a.NoError(err) fee := uint64(1000) @@ -101,7 +101,7 @@ log a.NoError(err) tx, err = client.FillUnsignedTxTemplate(creator, 0, 0, fee, tx) a.NoError(err) - wh, err = client.GetUnencryptedWalletHandle() + wh, err := client.GetUnencryptedWalletHandle() a.NoError(err) signedTxn, err := client.SignTransactionWithWallet(wh, nil, tx) a.NoError(err) @@ -122,6 +122,7 @@ log logs[31] = "c" b, err := client.BookkeepingBlock(round) + a.NoError(err) for _, ps := range b.Payset { ed := ps.ApplyData.EvalDelta ok = checkEqual(logs, ed.Logs) diff --git a/test/e2e-go/features/transactions/asset_test.go b/test/e2e-go/features/transactions/asset_test.go index fd21364b2..520f8af0e 100644 --- a/test/e2e-go/features/transactions/asset_test.go +++ b/test/e2e-go/features/transactions/asset_test.go @@ -67,10 +67,7 @@ func TestAssetValidRounds(t *testing.T) { client := fixture.LibGoalClient // First, test valid rounds to last valid conversion - var firstValid, lastValid, validRounds uint64 - firstValid = 0 - lastValid = 0 - validRounds = 0 + var firstValid, lastValid, lastRound, validRounds uint64 params, err := client.SuggestedParams() a.NoError(err) @@ -80,29 +77,29 @@ func TestAssetValidRounds(t *testing.T) { firstValid = 0 lastValid = 0 validRounds = cparams.MaxTxnLife + 1 - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + firstValid, lastValid, lastRound, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.NoError(err) - a.Equal(params.LastRound+1, firstValid) + a.Equal(lastRound+1, firstValid) a.Equal(firstValid+cparams.MaxTxnLife, lastValid) firstValid = 0 lastValid = 0 validRounds = cparams.MaxTxnLife + 2 - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + _, _, _, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.Error(err) a.True(strings.Contains(err.Error(), "cannot construct transaction: txn validity period")) firstValid = 0 lastValid = 0 validRounds = 1 - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.NoError(err) a.Equal(firstValid, lastValid) firstValid = 1 lastValid = 0 validRounds = 1 - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.NoError(err) a.Equal(uint64(1), firstValid) a.Equal(firstValid, lastValid) @@ -110,7 +107,7 @@ func TestAssetValidRounds(t *testing.T) { firstValid = 1 lastValid = 0 validRounds = cparams.MaxTxnLife - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.NoError(err) a.Equal(uint64(1), firstValid) a.Equal(cparams.MaxTxnLife, lastValid) @@ -118,7 +115,7 @@ func TestAssetValidRounds(t *testing.T) { firstValid = 100 lastValid = 0 validRounds = cparams.MaxTxnLife - firstValid, lastValid, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) + firstValid, lastValid, _, err = client.ComputeValidityRounds(firstValid, lastValid, validRounds) a.NoError(err) a.Equal(uint64(100), firstValid) a.Equal(firstValid+cparams.MaxTxnLife-1, lastValid) @@ -255,7 +252,6 @@ func TestAssetConfig(t *testing.T) { a.NoError(err) confirmed := fixture.WaitForAllTxnsToConfirm(status.LastRound+20, txids) a.True(confirmed, "creating max number of assets") - txids = make(map[string]string) // re-generate wh, since this test takes a while and sometimes // the wallet handle expires. @@ -265,7 +261,7 @@ func TestAssetConfig(t *testing.T) { var tx transactions.Transaction if config.Consensus[protocol.ConsensusFuture].MaxAssetsPerAccount != 0 { // Creating more assets should return an error - tx, err = client.MakeUnsignedAssetCreateTx(1, false, manager, reserve, freeze, clawback, fmt.Sprintf("toomany"), fmt.Sprintf("toomany"), assetURL, assetMetadataHash, 0) + tx, err = client.MakeUnsignedAssetCreateTx(1, false, manager, reserve, freeze, clawback, "toomany", "toomany", assetURL, assetMetadataHash, 0) _, err = helperFillSignBroadcast(client, wh, account0, tx, err) a.Error(err) a.True(strings.Contains(err.Error(), "too many assets in account:")) @@ -336,7 +332,6 @@ func TestAssetConfig(t *testing.T) { a.NoError(err) confirmed = fixture.WaitForAllTxnsToConfirm(status.LastRound+20, txids) a.True(confirmed, "changing keys") - txids = make(map[string]string) info, err = client.AccountInformation(account0) a.NoError(err) @@ -672,7 +667,7 @@ func TestAssetGroupCreateSendDestroy(t *testing.T) { a.Error(err) // sending it should fail txSend, err = client1.MakeUnsignedAssetSendTx(assetID3, 0, account1, "", "") - txid, err = helperFillSignBroadcast(client1, wh1, account1, txSend, err) + _, err = helperFillSignBroadcast(client1, wh1, account1, txSend, err) a.Error(err) } @@ -750,11 +745,11 @@ func TestAssetSend(t *testing.T) { // An account with no algos should not be able to accept assets tx, err = client.MakeUnsignedAssetSendTx(nonFrozenIdx, 0, extra, "", "") - txid, err = helperFillSignBroadcast(client, wh, account0, tx, err) + _, err = helperFillSignBroadcast(client, wh, account0, tx, err) a.NoError(err) tx, err = client.MakeUnsignedAssetSendTx(nonFrozenIdx, 0, extra, "", "") - txid, err = helperFillSignBroadcast(client, wh, extra, tx, err) + _, err = helperFillSignBroadcast(client, wh, extra, tx, err) a.Error(err) a.True(strings.Contains(err.Error(), "overspend")) a.True(strings.Contains(err.Error(), "tried to spend")) @@ -977,6 +972,7 @@ func TestAssetCreateWaitRestartDelete(t *testing.T) { // Destroy the asset tx, err := client.MakeUnsignedAssetDestroyTx(assetIndex) + a.NoError(err) submitAndWaitForTransaction(manager, tx, "destroying assets", client, fixture, a) // Check again that asset is destroyed @@ -986,6 +982,7 @@ func TestAssetCreateWaitRestartDelete(t *testing.T) { // Should be able to close now wh, err := client.GetUnencryptedWalletHandle() + a.NoError(err) _, err = client.SendPaymentFromWallet(wh, nil, account0, "", 0, 0, nil, reserve, 0, 0) a.NoError(err) } @@ -1047,6 +1044,7 @@ func TestAssetCreateWaitBalLookbackDelete(t *testing.T) { _, curRound := fixture.GetBalanceAndRound(account0) nodeStatus, _ := client.Status() consParams, err := client.ConsensusParams(nodeStatus.LastRound) + a.NoError(err) err = fixture.WaitForRoundWithTimeout(curRound + consParams.MaxBalLookback + 1) a.NoError(err) @@ -1063,6 +1061,7 @@ func TestAssetCreateWaitBalLookbackDelete(t *testing.T) { // Destroy the asset tx, err := client.MakeUnsignedAssetDestroyTx(assetIndex) + a.NoError(err) submitAndWaitForTransaction(manager, tx, "destroying assets", client, fixture, a) // Check again that asset is destroyed @@ -1072,6 +1071,7 @@ func TestAssetCreateWaitBalLookbackDelete(t *testing.T) { // Should be able to close now wh, err := client.GetUnencryptedWalletHandle() + a.NoError(err) _, err = client.SendPaymentFromWallet(wh, nil, account0, "", 0, 0, nil, reserve, 0, 0) a.NoError(err) } @@ -1084,7 +1084,7 @@ func setupTestAndNetwork(t *testing.T, networkTemplate string, consensus config. t.Parallel() asser := require.New(fixtures.SynchronizedTest(t)) - if 0 == len(networkTemplate) { + if len(networkTemplate) == 0 { // If the networkTemplate is not specified, used the default one networkTemplate = "TwoNodes50Each.json" } @@ -1113,6 +1113,7 @@ func createAsset(assetName, account0, manager, reserve, freeze, clawback string, // Create two assets: one with default-freeze, and one without default-freeze txids := make(map[string]string) wh, err := client.GetUnencryptedWalletHandle() + asser.NoError(err) tx, err := client.MakeUnsignedAssetCreateTx(100, false, manager, reserve, freeze, clawback, assetName, "testunit", assetURL, assetMetadataHash, 0) txid, err := helperFillSignBroadcast(*client, wh, account0, tx, err) asser.NoError(err) @@ -1128,6 +1129,7 @@ func setupActors(account0 string, client *libgoal.Client, asser *require.Asserti // Setup the actors wh, err := client.GetUnencryptedWalletHandle() + asser.NoError(err) manager, err = client.GenerateAddress(wh) asser.NoError(err) reserve, err = client.GenerateAddress(wh) diff --git a/test/e2e-go/features/transactions/onlineStatusChange_test.go b/test/e2e-go/features/transactions/onlineStatusChange_test.go index e954b9584..fdda7eea6 100644 --- a/test/e2e-go/features/transactions/onlineStatusChange_test.go +++ b/test/e2e-go/features/transactions/onlineStatusChange_test.go @@ -101,6 +101,7 @@ func testAccountsCanChangeOnlineState(t *testing.T, templatePath string) { goOfflineUTx, err := client.MakeUnsignedGoOfflineTx(initiallyOnline, curRound, curRound+transactionValidityPeriod, transactionFee, [32]byte{}) a.NoError(err, "should be able to make go offline tx") wh, err = client.GetUnencryptedWalletHandle() + a.NoError(err) offlineTxID, err := client.SignAndBroadcastTransaction(wh, nil, goOfflineUTx) a.NoError(err, "should be no errors when going offline") @@ -112,6 +113,7 @@ func testAccountsCanChangeOnlineState(t *testing.T, templatePath string) { becomeNonparticpatingUTx, err := client.MakeUnsignedBecomeNonparticipatingTx(becomesNonparticipating, curRound, curRound+transactionValidityPeriod, transactionFee) a.NoError(err, "should be able to make become-nonparticipating tx") wh, err = client.GetUnencryptedWalletHandle() + a.NoError(err) nonparticipatingTxID, err = client.SignAndBroadcastTransaction(wh, nil, becomeNonparticpatingUTx) a.NoError(err, "should be no errors when marking nonparticipating") } @@ -170,6 +172,7 @@ func TestCloseOnError(t *testing.T) { var partkeyFile string _, partkeyFile, err = client.GenParticipationKeysTo(initiallyOffline, 0, curRound+1000, 0, t.TempDir()) + a.NoError(err) // make a participation key for initiallyOffline _, err = client.AddParticipationKey(partkeyFile) diff --git a/test/e2e-go/features/transactions/sendReceive_test.go b/test/e2e-go/features/transactions/sendReceive_test.go index b21ec529f..693ed8f2a 100644 --- a/test/e2e-go/features/transactions/sendReceive_test.go +++ b/test/e2e-go/features/transactions/sendReceive_test.go @@ -93,7 +93,9 @@ func testAccountsCanSendMoney(t *testing.T, templatePath string, numberOfSends i } pingBalance, err := c.GetBalance(pingAccount) + a.NoError(err) pongBalance, err := c.GetBalance(pongAccount) + a.NoError(err) a.Equal(pingBalance, pongBalance, "both accounts should start with same balance") a.NotEqual(pingAccount, pongAccount, "accounts under study should be different") |