add eth_getTransactionCount

pull/7/head
Iuri Matias 6 years ago
parent 13a65fabd1
commit fa830de198
  1. 2
      remix-simulator/README.md
  2. 12
      remix-simulator/src/methods/transactions.js

@ -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

Loading…
Cancel
Save