Unverified Commit 8df8eb4e authored by Rachel Bousfield's avatar Rachel Bousfield Committed by GitHub

ethclient: add 'finalized' and 'safe' block number support (#25580)

parent 44b36a0c
......@@ -570,6 +570,14 @@ func toBlockNumArg(number *big.Int) string {
if number.Cmp(pending) == 0 {
return "pending"
}
finalized := big.NewInt(int64(rpc.FinalizedBlockNumber))
if number.Cmp(finalized) == 0 {
return "finalized"
}
safe := big.NewInt(int64(rpc.SafeBlockNumber))
if number.Cmp(safe) == 0 {
return "safe"
}
return hexutil.EncodeBig(number)
}
......
......@@ -187,6 +187,14 @@ func toBlockNumArg(number *big.Int) string {
if number.Cmp(pending) == 0 {
return "pending"
}
finalized := big.NewInt(int64(rpc.FinalizedBlockNumber))
if number.Cmp(finalized) == 0 {
return "finalized"
}
safe := big.NewInt(int64(rpc.SafeBlockNumber))
if number.Cmp(safe) == 0 {
return "safe"
}
return hexutil.EncodeBig(number)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment