mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-30 11:45:37 +00:00
linter: (1/2) enable errcheck (#5064)
## Description
partially cleanup in preparation for errcheck
i ignored a bunch of defer errors in tests but with the update to go 1.14 we can use `t.Cleanup(func() { if err := <>; err != nil {..}}` to cover those errors, I will do this in pr number two of enabling errcheck.
ref #5059
This commit is contained in:
+6
-3
@@ -178,7 +178,8 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
|
||||
incompletePartSet := types.NewPartSetFromHeader(types.PartSetHeader{Total: 2})
|
||||
uncontiguousPartSet := types.NewPartSetFromHeader(types.PartSetHeader{Total: 0})
|
||||
uncontiguousPartSet.AddPart(part2)
|
||||
_, err := uncontiguousPartSet.AddPart(part2)
|
||||
require.Error(t, err)
|
||||
|
||||
header1 := types.Header{
|
||||
Height: 1,
|
||||
@@ -303,7 +304,8 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
bBlockMeta := bs.LoadBlockMeta(tuple.block.Height)
|
||||
|
||||
if tuple.eraseSeenCommitInDB {
|
||||
db.Delete(calcSeenCommitKey(tuple.block.Height))
|
||||
err := db.Delete(calcSeenCommitKey(tuple.block.Height))
|
||||
require.NoError(t, err)
|
||||
}
|
||||
if tuple.corruptSeenCommitInDB {
|
||||
err := db.Set(calcSeenCommitKey(tuple.block.Height), []byte("bogus-seen-commit"))
|
||||
@@ -313,7 +315,8 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) {
|
||||
|
||||
commitHeight := tuple.block.Height - 1
|
||||
if tuple.eraseCommitInDB {
|
||||
db.Delete(calcBlockCommitKey(commitHeight))
|
||||
err := db.Delete(calcBlockCommitKey(commitHeight))
|
||||
require.NoError(t, err)
|
||||
}
|
||||
if tuple.corruptCommitInDB {
|
||||
err := db.Set(calcBlockCommitKey(commitHeight), []byte("foo-bogus"))
|
||||
|
||||
Reference in New Issue
Block a user