add eth_chainId JSON-RPC endpoint

This commit is contained in:
ramil
2021-04-20 00:52:58 +03:00
parent 9d590e15bc
commit f8b9d9475e
3 changed files with 21 additions and 4 deletions
+5 -1
View File
@@ -867,7 +867,11 @@ func (r *Resolver) Blocks(ctx context.Context, args struct {
if args.To != nil {
to = rpc.BlockNumber(*args.To)
} else {
to = rpc.BlockNumber(r.backend.CurrentBlock().Number().Int64())
block, err := r.backend.CurrentBlock()
if err != nil {
return []*Block{}, nil
}
to = rpc.BlockNumber(block.Number().Int64())
}
if to < from {
return []*Block{}, nil