add eth_getBlockTransactionCountByHash and eth_getBlockTransactionCountByNumber

pull/7/head
Iuri Matias 6 years ago
parent baec74b850
commit 857a718234
  1. 18
      remix-simulator/README.md
  2. 17
      remix-simulator/src/methods/blocks.js

@ -17,9 +17,9 @@ Implemented:
* [X] eth_blockNumber
* [X] eth_getBalance
* [_] eth_getStorageAt
* [~] eth_getTransactionCount
* [_] eth_getBlockTransactionCountByHash
* [_] eth_getBlockTransactionCountByNumber
* [X] eth_getTransactionCount
* [X] eth_getBlockTransactionCountByHash
* [X] eth_getBlockTransactionCountByNumber
* [_] eth_getUncleCountByBlockHash
* [_] eth_getUncleCountByBlockNumber
* [X] eth_getCode
@ -28,12 +28,12 @@ Implemented:
* [_] eth_sendRawTransaction
* [X] eth_call
* [~] eth_estimateGas
* [V] eth_getBlockByHash
* [V] eth_getBlockByNumber
* [V] eth_getTransactionByHash
* [V] eth_getTransactionByBlockHashAndIndex
* [V] eth_getTransactionByBlockNumberAndIndex
* [V] eth_getTransactionReceipt
* [X] eth_getBlockByHash
* [X] eth_getBlockByNumber
* [X] eth_getTransactionByHash
* [X] eth_getTransactionByBlockHashAndIndex
* [X] eth_getTransactionByBlockNumberAndIndex
* [X] eth_getTransactionReceipt
* [_] eth_getUncleByBlockHashAndIndex
* [_] eth_getUncleByBlockNumberAndIndex
* [X] eth_getCompilers (DEPRECATED)

@ -14,7 +14,9 @@ Blocks.prototype.methods = function () {
eth_gasPrice: this.eth_gasPrice.bind(this),
eth_coinbase: this.eth_coinbase.bind(this),
eth_blockNumber: this.eth_blockNumber.bind(this),
eth_getBlockByHash: this.eth_getBlockByHash.bind(this)
eth_getBlockByHash: this.eth_getBlockByHash.bind(this),
eth_getBlockTransactionCountByHash: this.eth_getBlockTransactionCountByHash.bind(this),
eth_getBlockTransactionCountByNumber: this.eth_getBlockTransactionCountByNumber.bind(this)
}
}
@ -96,4 +98,17 @@ Blocks.prototype.eth_blockNumber = function (payload, cb) {
cb(null, this.blockNumber)
}
Blocks.prototype.eth_getBlockTransactionCountByHash = function (payload, cb) {
var block = executionContext.blocks[payload.params[0]]
cb(null, block.transactions.length)
}
Blocks.prototype.eth_getBlockTransactionCountByNumber = function (payload, cb) {
var block = executionContext.blocks[payload.params[0]]
cb(null, block.transactions.length)
}
module.exports = Blocks

Loading…
Cancel
Save