Commit 857a7182 authored by Iuri Matias's avatar Iuri Matias

add eth_getBlockTransactionCountByHash and eth_getBlockTransactionCountByNumber

parent baec74b8
......@@ -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
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