From ecd5fea1ef7f6e4c9720f4bf4e1bd0d0d442bc15 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Thu, 7 Mar 2019 00:28:23 +0400 Subject: [PATCH] fix more ineffassign errors --- lite/proxy/query_test.go | 1 + p2p/conn/connection_test.go | 3 +-- state/execution_test.go | 2 +- state/state_test.go | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lite/proxy/query_test.go b/lite/proxy/query_test.go index c090de16..db2b6e46 100644 --- a/lite/proxy/query_test.go +++ b/lite/proxy/query_test.go @@ -93,6 +93,7 @@ func _TestAppProofs(t *testing.T) { // verify a query before the tx block has no data (and valid non-exist proof) bs, height, proof, err := GetWithProof(prt, k, brh-1, cl, cert) require.NoError(err, "%#v", err) + require.NotNil(proof) require.Equal(height, brh-1) // require.NotNil(proof) // TODO: Ensure that *some* keys will be there, ensuring that proof is nil, diff --git a/p2p/conn/connection_test.go b/p2p/conn/connection_test.go index 02018cc1..283b00eb 100644 --- a/p2p/conn/connection_test.go +++ b/p2p/conn/connection_test.go @@ -495,8 +495,7 @@ func TestMConnectionReadErrorUnknownMsgType(t *testing.T) { defer mconnServer.Stop() // send msg with unknown msg type - err := error(nil) - err = amino.EncodeUvarint(mconnClient.conn, 4) + err := amino.EncodeUvarint(mconnClient.conn, 4) assert.Nil(t, err) _, err = mconnClient.conn.Write([]byte{0xFF, 0xFF, 0xFF, 0xFF}) assert.Nil(t, err) diff --git a/state/execution_test.go b/state/execution_test.go index 4e7b44d7..a9fdfe27 100644 --- a/state/execution_test.go +++ b/state/execution_test.go @@ -44,7 +44,7 @@ func TestApplyBlock(t *testing.T) { blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} //nolint:ineffassign - state, err = blockExec.ApplyBlock(state, blockID, block) + state, err = blockExec.ApplyBlock(state, blockID, block) require.Nil(t, err) // TODO check state and mempool diff --git a/state/state_test.go b/state/state_test.go index 4566d93e..d69dc9a8 100644 --- a/state/state_test.go +++ b/state/state_test.go @@ -668,6 +668,7 @@ func TestLargeGenesisValidator(t *testing.T) { blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} updatedState, err := updateState(oldState, blockID, &block.Header, abciResponses, validatorUpdates) + require.NoError(t, err) // no changes in voting power (ProposerPrio += VotingPower == Voting in 1st round; than shiftByAvg == 0, // than -Total == -Voting) // -> no change in ProposerPrio (stays zero): @@ -692,6 +693,7 @@ func TestLargeGenesisValidator(t *testing.T) { block := makeBlock(oldState, oldState.LastBlockHeight+1) blockID := types.BlockID{block.Hash(), block.MakePartSet(testPartSize).Header()} updatedState, err := updateState(oldState, blockID, &block.Header, abciResponses, validatorUpdates) + require.NoError(t, err) lastState := updatedState for i := 0; i < 200; i++ {