From bce20dbfb6a4f4c3737f18180402dc4a3130cdd0 Mon Sep 17 00:00:00 2001 From: Juan Leni Date: Sun, 17 Mar 2019 14:56:34 +0100 Subject: [PATCH] fix linter issues --- node/node.go | 2 +- privval/file_test.go | 6 +++--- privval/signer_client_test.go | 4 ++-- privval/signer_dialer_endpoint.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/node/node.go b/node/node.go index fb6cbf98f..1bec6323a 100644 --- a/node/node.go +++ b/node/node.go @@ -16,7 +16,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/rs/cors" - "github.com/tendermint/go-amino" + amino "github.com/tendermint/go-amino" abci "github.com/tendermint/tendermint/abci/types" bc "github.com/tendermint/tendermint/blockchain" cfg "github.com/tendermint/tendermint/config" diff --git a/privval/file_test.go b/privval/file_test.go index 72363c697..0be132651 100644 --- a/privval/file_test.go +++ b/privval/file_test.go @@ -50,7 +50,7 @@ func TestResetValidator(t *testing.T) { // test vote height, round := int64(10), 1 voteType := byte(types.PrevoteType) - blockID := types.BlockID{[]byte{1, 2, 3}, types.PartSetHeader{}} + blockID := types.BlockID{Hash: []byte{1, 2, 3}} vote := newVote(privVal.Key.Address, 0, height, round, voteType, blockID) err = privVal.SignVote("mychainid", vote) assert.NoError(t, err, "expected no error signing vote") @@ -207,8 +207,8 @@ func TestSignProposal(t *testing.T) { privVal := GenFilePV(tempKeyFile.Name(), tempStateFile.Name()) - block1 := types.BlockID{[]byte{1, 2, 3}, types.PartSetHeader{5, []byte{1, 2, 3}}} - block2 := types.BlockID{[]byte{3, 2, 1}, types.PartSetHeader{10, []byte{3, 2, 1}}} + block1 := types.BlockID{Hash: []byte{1, 2, 3}, PartsHeader: types.PartSetHeader{Total: 5, Hash: []byte{1, 2, 3}}} + block2 := types.BlockID{Hash: []byte{3, 2, 1}, PartsHeader: types.PartSetHeader{Total: 10, Hash: []byte{3, 2, 1}}} height, round := int64(10), 1 // sign a proposal for first time diff --git a/privval/signer_client_test.go b/privval/signer_client_test.go index 738d04108..4aeed2b54 100644 --- a/privval/signer_client_test.go +++ b/privval/signer_client_test.go @@ -211,7 +211,7 @@ func TestSignerSignVoteErrors(t *testing.T) { } type BrokenSignerDialerEndpoint struct { - SignerDialerEndpoint + *SignerDialerEndpoint } func (ss *BrokenSignerDialerEndpoint) writeMessage(msg RemoteSignerMsg) (err error) { @@ -229,7 +229,7 @@ func TestSignerUnexpectedResponse(t *testing.T) { // Replace signer service with a broken one tc.signerService.OnStop() - tmp := BrokenSignerDialerEndpoint{*tc.signerService} + tmp := BrokenSignerDialerEndpoint{tc.signerService} tmp.OnStart() defer tmp.OnStop() diff --git a/privval/signer_dialer_endpoint.go b/privval/signer_dialer_endpoint.go index 7d430ddcf..15d4c2eed 100644 --- a/privval/signer_dialer_endpoint.go +++ b/privval/signer_dialer_endpoint.go @@ -112,7 +112,7 @@ func (ss *SignerDialerEndpoint) serviceLoop() { defer close(ss.stoppedCh) retries := 0 - var err error = nil + var err error for { select { @@ -130,7 +130,7 @@ func (ss *SignerDialerEndpoint) serviceLoop() { if err != nil { ss.conn = nil // Explicitly set to nil because dialer returns an interface (https://golang.org/doc/faq#nil_error) - retries += 1 + retries++ continue } }