Skip to content

Commit

Permalink
add back the missing committed input parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
wjrjerome committed Oct 25, 2023
1 parent 4bad837 commit 1e3911d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rpc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const (
)

// UnmarshalJSON parses the given JSON fragment into a BlockNumber. It supports:
// - "latest", "earliest" or "pending" as string arguments
// - "latest", "earliest", "pending" and "committed" as string arguments
// - the block number
// Returned errors:
// - an invalid block number error when the given argument isn't a known strings
Expand All @@ -99,6 +99,9 @@ func (bn *BlockNumber) UnmarshalJSON(data []byte) error {
case "pending":
*bn = PendingBlockNumber
return nil
case "committed":
*bn = CommittedBlockNumber
return nil
}

blckNum, err := hexutil.DecodeUint64(input)
Expand Down Expand Up @@ -157,6 +160,10 @@ func (bnh *BlockNumberOrHash) UnmarshalJSON(data []byte) error {
bn := PendingBlockNumber
bnh.BlockNumber = &bn
return nil
case "committed":
bn := CommittedBlockNumber
bnh.BlockNumber = &bn
return nil
default:
if len(input) == 66 {
hash := common.Hash{}
Expand Down

0 comments on commit 1e3911d

Please sign in to comment.