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

Commit

Permalink
chore(pkg): replace fmt.Errorf() with errors.New() if no param re…
Browse files Browse the repository at this point in the history
…quired (#759)
  • Loading branch information
bodhi-crypo authored and davidtaikocha committed Apr 24, 2024
1 parent 9f3f4c8 commit d8e1928
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pkg/rpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -638,31 +638,31 @@ func (c *Client) getSyncedL1SnippetFromAnchor(
common.Hash{},
0,
0,
fmt.Errorf("failed to parse l1BlockHash from anchor transaction calldata")
errors.New("failed to parse l1BlockHash from anchor transaction calldata")
}
l1StateRoot, ok = args["_l1StateRoot"].([32]byte)
if !ok {
return common.Hash{},
common.Hash{},
0,
0,
fmt.Errorf("failed to parse l1StateRoot from anchor transaction calldata")
errors.New("failed to parse l1StateRoot from anchor transaction calldata")
}
l1Height, ok = args["_l1BlockId"].(uint64)
if !ok {
return common.Hash{},
common.Hash{},
0,
0,
fmt.Errorf("failed to parse l1Height from anchor transaction calldata")
errors.New("failed to parse l1Height from anchor transaction calldata")
}
parentGasUsed, ok = args["_parentGasUsed"].(uint32)
if !ok {
return common.Hash{},
common.Hash{},
0,
0,
fmt.Errorf("failed to parse parentGasUsed from anchor transaction calldata")
errors.New("failed to parse parentGasUsed from anchor transaction calldata")
}

return l1BlockHash, l1StateRoot, l1Height, parentGasUsed, nil
Expand Down
3 changes: 2 additions & 1 deletion prover/anchor_tx_validator/anchor_tx_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package anchortxvalidator

import (
"context"
"errors"
"fmt"
"math/big"

Expand Down Expand Up @@ -69,7 +70,7 @@ func (v *AnchorTxValidator) GetAndValidateAnchorTxReceipt(
}

if len(receipt.Logs) == 0 {
return nil, fmt.Errorf("no event found in TaikoL2.anchor transaction receipt")
return nil, errors.New("no event found in TaikoL2.anchor transaction receipt")
}

return receipt, nil
Expand Down

0 comments on commit d8e1928

Please sign in to comment.