dev: fix: error related lint issues

This commit is contained in:
marcello33 2023-06-14 17:21:52 +02:00
parent 6850ca4d2d
commit 79ff0c17e1
7 changed files with 7 additions and 0 deletions

View file

@ -846,6 +846,7 @@ func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }
func (fb *filterBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
// nolint : exhaustive
switch number {
case rpc.PendingBlockNumber:
if block := fb.backend.pendingBlock; block != nil {

View file

@ -54,6 +54,7 @@ var (
_ rpc.DataError = new(EngineAPIError)
)
// nolint : errname
var (
// VALID is returned by the engine API in the following calls:
// - newPayloadV1: if the payload was already known or was just validated and executed

View file

@ -378,6 +378,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
return newcfg, stored, compatErr
}
// Don't overwrite if the old is identical to the new
// nolint : errchkjson
if newData, _ := json.Marshal(newcfg); !bytes.Equal(storedData, newData) {
rawdb.WriteChainConfig(db, stored, newcfg)
}

View file

@ -734,6 +734,7 @@ func increaseKey(key []byte) []byte {
// abortErr wraps an interruption signal received to represent the
// generation is aborted by external processes.
// nolint : errname
type abortErr struct {
abort chan *generatorStats
}

View file

@ -280,6 +280,7 @@ func CreateConsensusEngine(stack *node.Node, chainConfig *params.ChainConfig, et
return bor.New(chainConfig, db, blockchainAPI, spanner, heimdallClient, genesisContractsClient, false)
}
} else {
// nolint : exhaustive
switch ethashConfig.PowMode {
case ethash.ModeFake:
log.Warn("Ethash used in fake mode")

View file

@ -970,6 +970,7 @@ func TestTraceChain(t *testing.T) {
t.Error("Unexpected tracing result")
}
for _, trace := range result.Traces {
// nolint : errchkjson
blob, _ := json.Marshal(trace)
if string(blob) != single {
t.Error("Unexpected tracing result")

View file

@ -69,6 +69,7 @@ const (
DiscUnexpectedIdentity
DiscSelf
DiscReadTimeout
// nolint : errname
DiscSubprotocolError = DiscReason(0x10)
)