ethclient: serialize negative block number as "pending" (#21177)
Fixes #21175 Co-authored-by: sammy007 <sammy007@users.noreply.github.com> Co-authored-by: Adam Schmideg <adamschmideg@users.noreply.github.com>
This commit is contained in:
@ -282,6 +282,10 @@ func toBlockNumArg(number *big.Int) string {
|
||||
if number == nil {
|
||||
return "latest"
|
||||
}
|
||||
pending := big.NewInt(-1)
|
||||
if number.Cmp(pending) == 0 {
|
||||
return "pending"
|
||||
}
|
||||
return hexutil.EncodeBig(number)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user