From 6aa43305ee6642e79e656c873117200311c6ec14 Mon Sep 17 00:00:00 2001 From: Thomas Nguy <81727899+thomas-nguy@users.noreply.github.com> Date: Thu, 15 Jul 2021 20:07:23 +0900 Subject: [PATCH] rpc: fix `EthLatestBlockNumber` value (#300) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> --- ethereum/rpc/backend/backend.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ethereum/rpc/backend/backend.go b/ethereum/rpc/backend/backend.go index aedf5aac..4406c400 100644 --- a/ethereum/rpc/backend/backend.go +++ b/ethereum/rpc/backend/backend.go @@ -88,7 +88,7 @@ func (e *EVMBackend) GetBlockByNumber(blockNum types.BlockNumber, fullTx bool) ( switch blockNum { case types.EthLatestBlockNumber: if currentBlockNumber > 0 { - height = int64(currentBlockNumber - 1) + height = int64(currentBlockNumber) } case types.EthPendingBlockNumber: if currentBlockNumber > 0 { @@ -241,7 +241,7 @@ func (e *EVMBackend) HeaderByNumber(blockNum types.BlockNumber) (*ethtypes.Heade switch blockNum { case types.EthLatestBlockNumber: if currentBlockNumber > 0 { - height = int64(currentBlockNumber - 1) + height = int64(currentBlockNumber) } case types.EthPendingBlockNumber: if currentBlockNumber > 0 { @@ -363,7 +363,7 @@ func (e *EVMBackend) GetLogsByNumber(blockNum types.BlockNumber) ([][]*ethtypes. switch blockNum { case types.EthLatestBlockNumber: if currentBlockNumber > 0 { - height = int64(currentBlockNumber - 1) + height = int64(currentBlockNumber) } case types.EthPendingBlockNumber: if currentBlockNumber > 0 {