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

Conversation

@austinabell
Copy link

This does not depend on the format of tx data or receipts so can be merged in now.

To test:

  1. Run the Ethermint node how it is normally run, I ran:
make install 
rm -rf ~/.emint*
emintd init moniker --chain-id testchain
emintcli config chain-id testchain
emintcli config output json
emintcli config indent true
emintcli config trust-node true
emintcli keys add austin
<password>
<password>
emintd add-genesis-account $(emintcli keys show austin -a) 1000photon,100000000stake
emintd gentx --name austin
<password>
emintd collect-gentxs
emintd validate-genesis
emintd start
  1. Start rest server:
emintcli rest-server --laddr "tcp://localhost:8545"
  1. Send request:
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getBlockTransactionCountByNumber","params":["0x1"],"id":1}' -H "Content-Type: application/json" http://localhost:8545/rpc
 > {"jsonrpc":"2.0","id":1,"result":"0x0"}

Since txs can't be sent currently, it will always be 0, but I have tested with manual values that it correctly outputs other values if that is what is pulled from the TM node.

rpc/eth_api.go Outdated
node, _ := e.cliCtx.GetNode()

height := blockNum.Int64()
block, _ := node.Block(&height)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to say this will fail if a block number greater than the current block number is passed (can't confirm rn) and then we will get a panic on the next line

Copy link
Author

@austinabell austinabell Aug 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I'll add error handling for this. I was trying to follow the eth code but it doesn't make sense why error handling doesn't exist for this

@austinabell austinabell merged commit 9c00156 into development Sep 3, 2019
@austinabell austinabell deleted the austin/eth_gblocktxcountnum branch September 3, 2019 00:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants