Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit bb6c2bc

Browse files
Use New instead of Errorf
1 parent 8e94718 commit bb6c2bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/network/protocols/core/protocol.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func (p *Protocol) onBlock(blockData []byte, id peer.ID) {
216216

217217
func (p *Protocol) onBlockRequest(idBytes []byte, id peer.ID) {
218218
if len(idBytes) != iotago.BlockIDLength {
219-
p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize block request: invalid block id length"), id)
219+
p.Events.Error.Trigger(ierrors.New("failed to deserialize block request: invalid block id length"), id)
220220

221221
return
222222
}
@@ -237,7 +237,7 @@ func (p *Protocol) onSlotCommitment(commitmentBytes []byte, id peer.ID) {
237237

238238
func (p *Protocol) onSlotCommitmentRequest(idBytes []byte, id peer.ID) {
239239
if len(idBytes) != iotago.CommitmentIDLength {
240-
p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize slot commitment request: invalid commitment id length"), id)
240+
p.Events.Error.Trigger(ierrors.New("failed to deserialize slot commitment request: invalid commitment id length"), id)
241241

242242
return
243243
}
@@ -257,7 +257,7 @@ func (p *Protocol) onAttestations(commitmentBytes []byte, attestationsBytes []by
257257

258258
attestationsCount, err := stream.PeekSize(reader, serializer.SeriLengthPrefixTypeAsUint32)
259259
if err != nil {
260-
p.Events.Error.Trigger(ierrors.Errorf("failed peek attestations count"), id)
260+
p.Events.Error.Trigger(ierrors.New("failed peek attestations count"), id)
261261

262262
return
263263
}
@@ -294,7 +294,7 @@ func (p *Protocol) onAttestations(commitmentBytes []byte, attestationsBytes []by
294294

295295
func (p *Protocol) onAttestationsRequest(commitmentIDBytes []byte, id peer.ID) {
296296
if len(commitmentIDBytes) != iotago.CommitmentIDLength {
297-
p.Events.Error.Trigger(ierrors.Errorf("failed to deserialize commitmentID in attestations request: invalid commitment id length"), id)
297+
p.Events.Error.Trigger(ierrors.New("failed to deserialize commitmentID in attestations request: invalid commitment id length"), id)
298298

299299
return
300300
}

0 commit comments

Comments
 (0)