mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
refactor: enable errorlint and refactor code (#14110)
* refactor: enable errorlint and refactor code * revert * revert * add bazel * gofmt * gofmt * gofmt * gofmt * gci * lint --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
libp2pcore "github.com/libp2p/go-libp2p/core"
|
||||
corenet "github.com/libp2p/go-libp2p/core/network"
|
||||
"github.com/libp2p/go-libp2p/core/protocol"
|
||||
"github.com/pkg/errors"
|
||||
ssz "github.com/prysmaticlabs/fastssz"
|
||||
"github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p"
|
||||
p2ptypes "github.com/prysmaticlabs/prysm/v5/beacon-chain/p2p/types"
|
||||
@@ -51,7 +52,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) {
|
||||
// do not decode anything.
|
||||
if baseTopic == p2p.RPCMetaDataTopicV1 || baseTopic == p2p.RPCMetaDataTopicV2 {
|
||||
if err := handle(context.Background(), base, stream); err != nil {
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) {
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
}
|
||||
@@ -73,7 +74,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) {
|
||||
return
|
||||
}
|
||||
if err := handle(context.Background(), msg, stream); err != nil {
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) {
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
}
|
||||
@@ -89,7 +90,7 @@ func (c *client) registerRPCHandler(baseTopic string, handle rpcHandler) {
|
||||
return
|
||||
}
|
||||
if err := handle(context.Background(), nTyp.Elem().Interface(), stream); err != nil {
|
||||
if err != p2ptypes.ErrWrongForkDigestVersion {
|
||||
if !errors.Is(err, p2ptypes.ErrWrongForkDigestVersion) {
|
||||
log.WithError(err).Debug("Could not handle p2p RPC")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user