Commit 06de0e15 authored by Hamdi Allam's avatar Hamdi Allam

nits

parent e8c29cd9
...@@ -57,8 +57,8 @@ func (c *client) FinalizedBlockHeight() (*big.Int, error) { ...@@ -57,8 +57,8 @@ func (c *client) FinalizedBlockHeight() (*big.Int, error) {
ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout) ctxwt, cancel := context.WithTimeout(context.Background(), defaultRequestTimeout)
defer cancel() defer cancel()
// Local devnet is having issues with the "finalized" block tag. Switch to "latest" // **NOTE** Local devnet is having issues with the "finalized" block tag. Temp switch
// to iterate faster locally but this needs to be updated // to "latest" to iterate faster locally but this needs to be updated
header := new(types.Header) header := new(types.Header)
err := c.rpc.CallContext(ctxwt, header, "eth_getBlockByNumber", "latest", false) err := c.rpc.CallContext(ctxwt, header, "eth_getBlockByNumber", "latest", false)
if err != nil { if err != nil {
...@@ -222,18 +222,12 @@ func (c *rpcClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) err ...@@ -222,18 +222,12 @@ func (c *rpcClient) BatchCallContext(ctx context.Context, b []rpc.BatchElem) err
func toBlockNumArg(number *big.Int) string { func toBlockNumArg(number *big.Int) string {
if number == nil { if number == nil {
return "latest" return "latest"
} else if number.Sign() >= 0 { }
if number.Sign() >= 0 {
return hexutil.EncodeBig(number) return hexutil.EncodeBig(number)
} }
// It's negative. // It's negative.
if number.IsInt64() { return rpc.BlockNumber(number.Int64()).String()
tag, _ := rpc.BlockNumber(number.Int64()).MarshalText()
return string(tag)
}
// It's negative and large, which is invalid.
return fmt.Sprintf("<invalid %d>", number)
} }
func toFilterArg(q ethereum.FilterQuery) (interface{}, error) { func toFilterArg(q ethereum.FilterQuery) (interface{}, error) {
......
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