Browse Source

fix linter issues

pull/3370/head
Juan Leni 6 years ago
parent
commit
bce20dbfb6
No known key found for this signature in database GPG Key ID: 23F1452155140419
4 changed files with 8 additions and 8 deletions
  1. +1
    -1
      node/node.go
  2. +3
    -3
      privval/file_test.go
  3. +2
    -2
      privval/signer_client_test.go
  4. +2
    -2
      privval/signer_dialer_endpoint.go

+ 1
- 1
node/node.go View File

@ -16,7 +16,7 @@ import (
"github.com/prometheus/client_golang/prometheus/promhttp" "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rs/cors" "github.com/rs/cors"
"github.com/tendermint/go-amino"
amino "github.com/tendermint/go-amino"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
bc "github.com/tendermint/tendermint/blockchain" bc "github.com/tendermint/tendermint/blockchain"
cfg "github.com/tendermint/tendermint/config" cfg "github.com/tendermint/tendermint/config"


+ 3
- 3
privval/file_test.go View File

@ -50,7 +50,7 @@ func TestResetValidator(t *testing.T) {
// test vote // test vote
height, round := int64(10), 1 height, round := int64(10), 1
voteType := byte(types.PrevoteType) 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) vote := newVote(privVal.Key.Address, 0, height, round, voteType, blockID)
err = privVal.SignVote("mychainid", vote) err = privVal.SignVote("mychainid", vote)
assert.NoError(t, err, "expected no error signing 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()) 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 height, round := int64(10), 1
// sign a proposal for first time // sign a proposal for first time


+ 2
- 2
privval/signer_client_test.go View File

@ -211,7 +211,7 @@ func TestSignerSignVoteErrors(t *testing.T) {
} }
type BrokenSignerDialerEndpoint struct { type BrokenSignerDialerEndpoint struct {
SignerDialerEndpoint
*SignerDialerEndpoint
} }
func (ss *BrokenSignerDialerEndpoint) writeMessage(msg RemoteSignerMsg) (err error) { func (ss *BrokenSignerDialerEndpoint) writeMessage(msg RemoteSignerMsg) (err error) {
@ -229,7 +229,7 @@ func TestSignerUnexpectedResponse(t *testing.T) {
// Replace signer service with a broken one // Replace signer service with a broken one
tc.signerService.OnStop() tc.signerService.OnStop()
tmp := BrokenSignerDialerEndpoint{*tc.signerService}
tmp := BrokenSignerDialerEndpoint{tc.signerService}
tmp.OnStart() tmp.OnStart()
defer tmp.OnStop() defer tmp.OnStop()


+ 2
- 2
privval/signer_dialer_endpoint.go View File

@ -112,7 +112,7 @@ func (ss *SignerDialerEndpoint) serviceLoop() {
defer close(ss.stoppedCh) defer close(ss.stoppedCh)
retries := 0 retries := 0
var err error = nil
var err error
for { for {
select { select {
@ -130,7 +130,7 @@ func (ss *SignerDialerEndpoint) serviceLoop() {
if err != nil { if err != nil {
ss.conn = nil // Explicitly set to nil because dialer returns an interface (https://golang.org/doc/faq#nil_error) ss.conn = nil // Explicitly set to nil because dialer returns an interface (https://golang.org/doc/faq#nil_error)
retries += 1
retries++
continue continue
} }
} }


Loading…
Cancel
Save