lint: cleanup pending lint errors (#7237)

This commit is contained in:
Sam Kleinman
2021-11-04 13:08:55 +01:00
committed by GitHub
parent 61831cf5ef
commit 4ef140f6ca
35 changed files with 65 additions and 46 deletions

View File

@@ -23,7 +23,7 @@ type EventBusSubscriber interface {
type Subscription interface {
Out() <-chan tmpubsub.Message
Cancelled() <-chan struct{}
Cancelled() <-chan struct{} // nolint: misspell
Err() error
}

View File

@@ -84,7 +84,7 @@ func TestGenesisGood(t *testing.T) {
Validators: []GenesisValidator{{pubkey.Address(), pubkey, 10, "myval"}},
}
genDocBytes, err = tmjson.Marshal(baseGenDoc)
assert.NoError(t, err, "error marshalling genDoc")
assert.NoError(t, err, "error marshaling genDoc")
// test base gendoc and check consensus params were filled
genDoc, err := GenesisDocFromJSON(genDocBytes)
@@ -96,14 +96,14 @@ func TestGenesisGood(t *testing.T) {
// create json with consensus params filled
genDocBytes, err = tmjson.Marshal(genDoc)
assert.NoError(t, err, "error marshalling genDoc")
assert.NoError(t, err, "error marshaling genDoc")
genDoc, err = GenesisDocFromJSON(genDocBytes)
assert.NoError(t, err, "expected no error for valid genDoc json")
// test with invalid consensus params
genDoc.ConsensusParams.Block.MaxBytes = 0
genDocBytes, err = tmjson.Marshal(genDoc)
assert.NoError(t, err, "error marshalling genDoc")
assert.NoError(t, err, "error marshaling genDoc")
_, err = GenesisDocFromJSON(genDocBytes)
assert.Error(t, err, "expected error for genDoc json with block size of 0")

View File

@@ -17,7 +17,7 @@ var (
// SignBytes returns the bytes to be signed
// NOTE: chainIDs are part of the SignBytes but not
// necessarily the object themselves.
// NOTE: Expected to panic if there is an error marshalling.
// NOTE: Expected to panic if there is an error marshaling.
type Signable interface {
SignBytes(chainID string) []byte
}

View File

@@ -492,7 +492,9 @@ func TestAveragingInIncrementProposerPriority(t *testing.T) {
{Address: []byte("c"), ProposerPriority: 1}}},
// this should average twice but the average should be 0 after the first iteration
// (voting power is 0 -> no changes)
11, 1 / 3},
11,
0, // 1 / 3
},
2: {ValidatorSet{
Validators: []*Validator{
{Address: []byte("a"), ProposerPriority: 100},