added transactionCount && uncleCount methods
This commit is contained in:
parent
b96a7aa1d3
commit
ec6f9b3d08
|
@ -563,6 +563,14 @@ var methods = function () {
|
|||
return typeof args[0] === "string" ? 'eth_uncleByHash' : 'eth_uncleByNumber';
|
||||
};
|
||||
|
||||
var transactionCountCall = function (args) {
|
||||
return typeof args[0] === "string" ? 'eth_transactionCountByHash' : 'eth_transactionCountByNumber';
|
||||
};
|
||||
|
||||
var uncleCountCall = function (args) {
|
||||
return typeof args[0] === "string" ? 'eth_uncleCountByHash' : 'eth_uncleCountByNumber';
|
||||
};
|
||||
|
||||
return [
|
||||
{ name: 'balanceAt', call: 'eth_balanceAt' },
|
||||
{ name: 'stateAt', call: 'eth_stateAt' },
|
||||
|
@ -579,7 +587,9 @@ var methods = function () {
|
|||
{ name: 'lll', call: 'eth_lll' },
|
||||
{ name: 'solidity', call: 'eth_solidity' },
|
||||
{ name: 'serpent', call: 'eth_serpent' },
|
||||
{ name: 'logs', call: 'eth_logs' }
|
||||
{ name: 'logs', call: 'eth_logs' },
|
||||
{ name: 'transactionCount', call: transactionCountCall },
|
||||
{ name: 'uncleCount', call: uncleCountCall }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
12
lib/eth.js
12
lib/eth.js
|
@ -34,6 +34,14 @@ var methods = function () {
|
|||
return typeof args[0] === "string" ? 'eth_uncleByHash' : 'eth_uncleByNumber';
|
||||
};
|
||||
|
||||
var transactionCountCall = function (args) {
|
||||
return typeof args[0] === "string" ? 'eth_transactionCountByHash' : 'eth_transactionCountByNumber';
|
||||
};
|
||||
|
||||
var uncleCountCall = function (args) {
|
||||
return typeof args[0] === "string" ? 'eth_uncleCountByHash' : 'eth_uncleCountByNumber';
|
||||
};
|
||||
|
||||
return [
|
||||
{ name: 'balanceAt', call: 'eth_balanceAt' },
|
||||
{ name: 'stateAt', call: 'eth_stateAt' },
|
||||
|
@ -50,7 +58,9 @@ var methods = function () {
|
|||
{ name: 'lll', call: 'eth_lll' },
|
||||
{ name: 'solidity', call: 'eth_solidity' },
|
||||
{ name: 'serpent', call: 'eth_serpent' },
|
||||
{ name: 'logs', call: 'eth_logs' }
|
||||
{ name: 'logs', call: 'eth_logs' },
|
||||
{ name: 'transactionCount', call: transactionCountCall },
|
||||
{ name: 'uncleCount', call: uncleCountCall }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ describe('web3', function() {
|
|||
u.methodExists(web3.eth, 'solidity');
|
||||
u.methodExists(web3.eth, 'serpent');
|
||||
u.methodExists(web3.eth, 'logs');
|
||||
u.methodExists(web3.eth, 'transactionCount');
|
||||
u.methodExists(web3.eth, 'uncleCount');
|
||||
|
||||
u.propertyExists(web3.eth, 'coinbase');
|
||||
u.propertyExists(web3.eth, 'listening');
|
||||
|
|
Loading…
Reference in New Issue