Commit fa830de1 authored by Iuri Matias's avatar Iuri Matias

add eth_getTransactionCount

parent 13a65fab
......@@ -17,7 +17,7 @@ Implemented:
* [X] eth_blockNumber
* [X] eth_getBalance
* [_] eth_getStorageAt
* [_] eth_getTransactionCount
* [X] eth_getTransactionCount
* [_] eth_getBlockTransactionCountByHash
* [_] eth_getBlockTransactionCountByNumber
* [_] eth_getUncleCountByBlockHash
......
......@@ -14,7 +14,8 @@ Transactions.prototype.methods = function () {
eth_getTransactionReceipt: this.eth_getTransactionReceipt.bind(this),
eth_getCode: this.eth_getCode.bind(this),
eth_call: this.eth_call.bind(this),
eth_estimateGas: this.eth_estimateGas.bind(this)
eth_estimateGas: this.eth_estimateGas.bind(this),
eth_getTransactionCount: this.eth_getTransactionCount.bind(this)
}
}
......@@ -60,4 +61,13 @@ Transactions.prototype.eth_call = function (payload, cb) {
processTx(this.accounts, payload, true, cb)
}
Transactions.prototype.eth_getTransactionCount = function (payload, cb) {
let address = payload.params[0]
executionContext.vm().stateManager.getAccount(address, (err, account) => {
let nonce = new BN(account.nonce).toString(10)
cb(null, nonce)
})
}
module.exports = Transactions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment