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

add eth_getBlockTransactionCountByHash and eth_getBlockTransactionCountByNumber

parent baec74b8
...@@ -17,9 +17,9 @@ Implemented: ...@@ -17,9 +17,9 @@ Implemented:
* [X] eth_blockNumber * [X] eth_blockNumber
* [X] eth_getBalance * [X] eth_getBalance
* [_] eth_getStorageAt * [_] eth_getStorageAt
* [~] eth_getTransactionCount * [X] eth_getTransactionCount
* [_] eth_getBlockTransactionCountByHash * [X] eth_getBlockTransactionCountByHash
* [_] eth_getBlockTransactionCountByNumber * [X] eth_getBlockTransactionCountByNumber
* [_] eth_getUncleCountByBlockHash * [_] eth_getUncleCountByBlockHash
* [_] eth_getUncleCountByBlockNumber * [_] eth_getUncleCountByBlockNumber
* [X] eth_getCode * [X] eth_getCode
...@@ -28,12 +28,12 @@ Implemented: ...@@ -28,12 +28,12 @@ Implemented:
* [_] eth_sendRawTransaction * [_] eth_sendRawTransaction
* [X] eth_call * [X] eth_call
* [~] eth_estimateGas * [~] eth_estimateGas
* [V] eth_getBlockByHash * [X] eth_getBlockByHash
* [V] eth_getBlockByNumber * [X] eth_getBlockByNumber
* [V] eth_getTransactionByHash * [X] eth_getTransactionByHash
* [V] eth_getTransactionByBlockHashAndIndex * [X] eth_getTransactionByBlockHashAndIndex
* [V] eth_getTransactionByBlockNumberAndIndex * [X] eth_getTransactionByBlockNumberAndIndex
* [V] eth_getTransactionReceipt * [X] eth_getTransactionReceipt
* [_] eth_getUncleByBlockHashAndIndex * [_] eth_getUncleByBlockHashAndIndex
* [_] eth_getUncleByBlockNumberAndIndex * [_] eth_getUncleByBlockNumberAndIndex
* [X] eth_getCompilers (DEPRECATED) * [X] eth_getCompilers (DEPRECATED)
......
...@@ -14,7 +14,9 @@ Blocks.prototype.methods = function () { ...@@ -14,7 +14,9 @@ Blocks.prototype.methods = function () {
eth_gasPrice: this.eth_gasPrice.bind(this), eth_gasPrice: this.eth_gasPrice.bind(this),
eth_coinbase: this.eth_coinbase.bind(this), eth_coinbase: this.eth_coinbase.bind(this),
eth_blockNumber: this.eth_blockNumber.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) { ...@@ -96,4 +98,17 @@ Blocks.prototype.eth_blockNumber = function (payload, cb) {
cb(null, this.blockNumber) 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 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