diff --git a/blockchain/v2/reactor_test.go b/blockchain/v2/reactor_test.go index ea9e0d9a2..78a99a9f8 100644 --- a/blockchain/v2/reactor_test.go +++ b/blockchain/v2/reactor_test.go @@ -64,14 +64,17 @@ type mockBlockStore struct { blocks map[int64]*types.Block } +//nolint:unused func (ml *mockBlockStore) Height() int64 { return int64(len(ml.blocks)) } +//nolint:unused func (ml *mockBlockStore) LoadBlock(height int64) *types.Block { return ml.blocks[height] } +//nolint:unused func (ml *mockBlockStore) SaveBlock(block *types.Block, part *types.PartSet, commit *types.Commit) { ml.blocks[block.Height] = block } diff --git a/crypto/hash.go b/crypto/hash.go index dd1b4c1dd..e1d22523f 100644 --- a/crypto/hash.go +++ b/crypto/hash.go @@ -6,6 +6,6 @@ import ( func Sha256(bytes []byte) []byte { hasher := sha256.New() - hasher.Write(bytes) //nolint:errcheck // ignore error + hasher.Write(bytes) return hasher.Sum(nil) } diff --git a/crypto/merkle/proof_value.go b/crypto/merkle/proof_value.go index b613ebe31..842dc8201 100644 --- a/crypto/merkle/proof_value.go +++ b/crypto/merkle/proof_value.go @@ -80,7 +80,7 @@ func (op ValueOp) Run(args [][]byte) ([][]byte, error) { } value := args[0] hasher := tmhash.New() - hasher.Write(value) //nolint: errcheck // does not error + hasher.Write(value) vhash := hasher.Sum(nil) bz := new(bytes.Buffer) diff --git a/mempool/clist_mempool_test.go b/mempool/clist_mempool_test.go index 19ca5b9a1..b43888df6 100644 --- a/mempool/clist_mempool_test.go +++ b/mempool/clist_mempool_test.go @@ -653,7 +653,7 @@ func newRemoteApp( } func checksumIt(data []byte) string { h := sha256.New() - h.Write(data) //nolint: errcheck // ignore errcheck + h.Write(data) return fmt.Sprintf("%x", h.Sum(nil)) } diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index 49daec014..f9faabc09 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -941,6 +941,6 @@ func (a *addrBook) hash(b []byte) ([]byte, error) { if err != nil { return nil, err } - hasher.Write(b) //nolint:errcheck // ignore error + hasher.Write(b) return hasher.Sum(nil), nil } diff --git a/statesync/snapshots.go b/statesync/snapshots.go index 53ffed4e7..1dd3a6d34 100644 --- a/statesync/snapshots.go +++ b/statesync/snapshots.go @@ -33,9 +33,9 @@ type snapshot struct { func (s *snapshot) Key() snapshotKey { // Hash.Write() never returns an error. hasher := sha256.New() - hasher.Write([]byte(fmt.Sprintf("%v:%v:%v", s.Height, s.Format, s.Chunks))) //nolint:errcheck // ignore error - hasher.Write(s.Hash) //nolint:errcheck // ignore error - hasher.Write(s.Metadata) //nolint:errcheck // ignore error + hasher.Write([]byte(fmt.Sprintf("%v:%v:%v", s.Height, s.Format, s.Chunks))) + hasher.Write(s.Hash) + hasher.Write(s.Metadata) var key snapshotKey copy(key[:], hasher.Sum(nil)) return key