From bb6c2bca7d86427d62550f72a1003bea7e4aaba9 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Wed, 13 Mar 2024 20:26:24 +0800 Subject: [PATCH] Use New instead of Errorf --- pkg/network/protocols/core/protocol.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/network/protocols/core/protocol.go b/pkg/network/protocols/core/protocol.go index 7f49e88b6..458a62015 100644 --- a/pkg/network/protocols/core/protocol.go +++ b/pkg/network/protocols/core/protocol.go @@ -216,7 +216,7 @@ func (p *Protocol) onBlock(blockData []byte, id peer.ID) { func (p *Protocol) onBlockRequest(idBytes []byte, id peer.ID) { if len(idBytes) != iotago.BlockIDLength { - p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize block request: invalid block id length"), id) + p.Events.Error.Trigger(ierrors.New("failed to deserialize block request: invalid block id length"), id) return } @@ -237,7 +237,7 @@ func (p *Protocol) onSlotCommitment(commitmentBytes []byte, id peer.ID) { func (p *Protocol) onSlotCommitmentRequest(idBytes []byte, id peer.ID) { if len(idBytes) != iotago.CommitmentIDLength { - p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize slot commitment request: invalid commitment id length"), id) + p.Events.Error.Trigger(ierrors.New("failed to deserialize slot commitment request: invalid commitment id length"), id) return } @@ -257,7 +257,7 @@ func (p *Protocol) onAttestations(commitmentBytes []byte, attestationsBytes []by attestationsCount, err := stream.PeekSize(reader, serializer.SeriLengthPrefixTypeAsUint32) if err != nil { - p.Events.Error.Trigger(ierrors.Errorf("failed peek attestations count"), id) + p.Events.Error.Trigger(ierrors.New("failed peek attestations count"), id) return } @@ -294,7 +294,7 @@ func (p *Protocol) onAttestations(commitmentBytes []byte, attestationsBytes []by func (p *Protocol) onAttestationsRequest(commitmentIDBytes []byte, id peer.ID) { if len(commitmentIDBytes) != iotago.CommitmentIDLength { - p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize commitmentID in attestations request: invalid commitment id length"), id) + p.Events.Error.Trigger(ierrors.New("failed to deserialize commitmentID in attestations request: invalid commitment id length"), id) return }