Skip to content
This repository was archived by the owner on May 11, 2024. It is now read-only.

Commit d8e1928

Browse files
bodhi-crypodavidtaikocha
authored andcommitted
chore(pkg): replace fmt.Errorf() with errors.New() if no param required (#759)
1 parent 9f3f4c8 commit d8e1928

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pkg/rpc/methods.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,31 +638,31 @@ func (c *Client) getSyncedL1SnippetFromAnchor(
638638
common.Hash{},
639639
0,
640640
0,
641-
fmt.Errorf("failed to parse l1BlockHash from anchor transaction calldata")
641+
errors.New("failed to parse l1BlockHash from anchor transaction calldata")
642642
}
643643
l1StateRoot, ok = args["_l1StateRoot"].([32]byte)
644644
if !ok {
645645
return common.Hash{},
646646
common.Hash{},
647647
0,
648648
0,
649-
fmt.Errorf("failed to parse l1StateRoot from anchor transaction calldata")
649+
errors.New("failed to parse l1StateRoot from anchor transaction calldata")
650650
}
651651
l1Height, ok = args["_l1BlockId"].(uint64)
652652
if !ok {
653653
return common.Hash{},
654654
common.Hash{},
655655
0,
656656
0,
657-
fmt.Errorf("failed to parse l1Height from anchor transaction calldata")
657+
errors.New("failed to parse l1Height from anchor transaction calldata")
658658
}
659659
parentGasUsed, ok = args["_parentGasUsed"].(uint32)
660660
if !ok {
661661
return common.Hash{},
662662
common.Hash{},
663663
0,
664664
0,
665-
fmt.Errorf("failed to parse parentGasUsed from anchor transaction calldata")
665+
errors.New("failed to parse parentGasUsed from anchor transaction calldata")
666666
}
667667

668668
return l1BlockHash, l1StateRoot, l1Height, parentGasUsed, nil

prover/anchor_tx_validator/anchor_tx_validator.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package anchortxvalidator
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"math/big"
78

@@ -69,7 +70,7 @@ func (v *AnchorTxValidator) GetAndValidateAnchorTxReceipt(
6970
}
7071

7172
if len(receipt.Logs) == 0 {
72-
return nil, fmt.Errorf("no event found in TaikoL2.anchor transaction receipt")
73+
return nil, errors.New("no event found in TaikoL2.anchor transaction receipt")
7374
}
7475

7576
return receipt, nil

0 commit comments

Comments
 (0)