mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-24 03:00:25 +00:00
eth_getTransactionByBlockNumberAndIndex
This commit is contained in:
parent
3b53f18b84
commit
79b0032583
@ -357,7 +357,20 @@ proc setupP2PRPC*(node: EthereumNode, rpcsrv: RpcServer) =
|
||||
##
|
||||
## quantityTag: a block number, or the string "earliest", "latest" or "pending", as in the default block parameter.
|
||||
## quantity: the transaction index position.
|
||||
discard
|
||||
let
|
||||
header = chain.headerFromTag(quantityTag)
|
||||
blockHash = header.hash
|
||||
body = chain.getBlockBody(blockHash)
|
||||
transaction = body.transactions[quantity]
|
||||
vmState = newBaseVMState(header, chain)
|
||||
addressDb = vmState.chaindb.getStateDb(blockHash, true)
|
||||
# TODO: Get/calculate address for this transaction
|
||||
address = ZERO_ADDRESS
|
||||
txCount = addressDb.getNonce(address)
|
||||
txHash = transaction.rlpHash
|
||||
# TODO: Fetch account gas
|
||||
accountGas = 0
|
||||
populateTransactionObject(transaction, txHash, txCount, quantity, header, accountGas)
|
||||
|
||||
# Currently defined as a variant type so this might need rethinking
|
||||
# See: https://github.com/status-im/nim-json-rpc/issues/29
|
||||
|
Loading…
x
Reference in New Issue
Block a user