Browse Source

linting: few more fixes

pull/703/head
Zach Ramsay 7 years ago
committed by Ethan Buchman
parent
commit
c84c7250ba
4 changed files with 4 additions and 17 deletions
  1. +1
    -1
      Makefile
  2. +1
    -4
      rpc/lib/server/handlers.go
  3. +0
    -1
      state/execution.go
  4. +2
    -11
      types/vote_set_test.go

+ 1
- 1
Makefile View File

@ -88,7 +88,6 @@ metalinter_test: ensure_tools
@gometalinter --install
@gometalinter --vendor --deadline=600s --disable-all \
--enable=deadcode \
--enable=errcheck \
--enable=gas \
--enable=gosimple \
--enable=ineffassign \
@ -100,6 +99,7 @@ metalinter_test: ensure_tools
#--enable=aligncheck \
#--enable=dupl \
#--enable=errcheck \
#--enable=goconst \
#--enable=gocyclo \
#--enable=goimports \


+ 1
- 4
rpc/lib/server/handlers.go View File

@ -529,12 +529,9 @@ func (wsc *wsConnection) readRoutine() {
wsc.WriteRPCResponse(types.RPCInternalError("unknown", err))
go wsc.readRoutine()
} else {
if err := wsc.baseConn.Close(); err != nil {
panic(err)
}
wsc.baseConn.Close() // nolint: errcheck
}
}()
defer wsc.baseConn.Close()
wsc.baseConn.SetPongHandler(func(m string) error {
return wsc.baseConn.SetReadDeadline(time.Now().Add(wsc.readWait))


+ 0
- 1
state/execution.go View File

@ -293,7 +293,6 @@ func (s *State) indexTxs(abciResponses *ABCIResponses) {
}
if err := s.TxIndexer.AddBatch(batch); err != nil {
s.logger.Error("Error adding batch", "err", err)
panic(err)
}
}


+ 2
- 11
types/vote_set_test.go View File

@ -237,14 +237,10 @@ func Test2_3MajorityRedux(t *testing.T) {
// 70th validator voted for different BlockHash
{
vote := withValidator(voteProto, privValidators[69].GetAddress(), 69)
<<<<<<< 026e76894f49dbfbd47601158c7e720b9545fd42
signAddVote(privValidators[69], withBlockHash(vote, cmn.RandBytes(32)), voteSet)
=======
_, err := signAddVote(privValidators[69], withBlockHash(vote, RandBytes(32)), voteSet)
_, err := signAddVote(privValidators[69], withBlockHash(vote, cmn.RandBytes(32)), voteSet)
if err != nil {
t.Error(err)
}
>>>>>>> linting: apply errcheck part1
blockID, ok = voteSet.TwoThirdsMajority()
if ok || !blockID.IsZero() {
t.Errorf("There should be no 2/3 majority: last vote added had different BlockHash")
@ -482,18 +478,13 @@ func TestMakeCommit(t *testing.T) {
// 7th voted for some other block.
{
vote := withValidator(voteProto, privValidators[6].GetAddress(), 6)
<<<<<<< 026e76894f49dbfbd47601158c7e720b9545fd42
vote = withBlockHash(vote, cmn.RandBytes(32))
vote = withBlockPartsHeader(vote, PartSetHeader{123, cmn.RandBytes(32)})
signAddVote(privValidators[6], vote, voteSet)
=======
vote = withBlockHash(vote, RandBytes(32))
vote = withBlockPartsHeader(vote, PartSetHeader{123, RandBytes(32)})
_, err := signAddVote(privValidators[6], vote, voteSet)
if err != nil {
t.Error(err)
}
>>>>>>> linting: apply errcheck part1
}
// The 8th voted like everyone else.


Loading…
Cancel
Save