Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
araskachoi committed Oct 20, 2020
1 parent 7b49761 commit f6550be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rpc/eth_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ func (e *PublicEthAPI) GetBalance(address common.Address, blockNum BlockNumber)
e.logger.Debug("eth_getBalance", "address", address, "block number", blockNum)
pendingQuery := false
var ctx context.CLIContext
if blockNum.Int64() == int64(-1) {
if blockNum == PendingBlockNumber {
// uses latest block number for pending: -1 -> 0
ctx = e.cliCtx.WithHeight(int64(0))
ctx = e.cliCtx.WithHeight(LatestBlockNumber.Int64())
pendingQuery = true
} else {
ctx = e.cliCtx.WithHeight(blockNum.Int64())
Expand Down Expand Up @@ -279,9 +279,9 @@ func (e *PublicEthAPI) GetTransactionCount(address common.Address, blockNum Bloc
e.logger.Debug("eth_getTransactionCount", "address", address, "block number", blockNum)
pendingQuery := false
var ctx context.CLIContext
if blockNum.Int64() == int64(-1) {
if blockNum == PendingBlockNumber {
// uses latest block number for pending: -1 -> 0
ctx = e.cliCtx.WithHeight(int64(0))
ctx = e.cliCtx.WithHeight(LatestBlockNumber.Int64())
pendingQuery = true
} else {
ctx = e.cliCtx.WithHeight(blockNum.Int64())
Expand Down

0 comments on commit f6550be

Please sign in to comment.