web3.eth.getBlockTransactionCount accepts pending/latest/earliest params

This commit is contained in:
Marek Kotewicz 2015-04-02 16:30:40 +02:00
parent 94429fffdd
commit e2990ae77e
9 changed files with 23 additions and 11 deletions

View File

@ -1687,7 +1687,7 @@ var getBlockTransactionCount = new Method({
name: 'getBlockTransactionCount', name: 'getBlockTransactionCount',
call: getBlockTransactionCountCall, call: getBlockTransactionCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });
@ -1695,7 +1695,7 @@ var getBlockUncleCount = new Method({
name: 'getBlockUncleCount', name: 'getBlockUncleCount',
call: uncleCountCall, call: uncleCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
dist/ethereum.js vendored
View File

@ -1687,7 +1687,7 @@ var getBlockTransactionCount = new Method({
name: 'getBlockTransactionCount', name: 'getBlockTransactionCount',
call: getBlockTransactionCountCall, call: getBlockTransactionCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });
@ -1695,7 +1695,7 @@ var getBlockUncleCount = new Method({
name: 'getBlockUncleCount', name: 'getBlockUncleCount',
call: uncleCountCall, call: uncleCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -125,7 +125,7 @@ var getBlockTransactionCount = new Method({
name: 'getBlockTransactionCount', name: 'getBlockTransactionCount',
call: getBlockTransactionCountCall, call: getBlockTransactionCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });
@ -133,7 +133,7 @@ var getBlockUncleCount = new Method({
name: 'getBlockUncleCount', name: 'getBlockUncleCount',
call: uncleCountCall, call: uncleCountCall,
params: 1, params: 1,
inputFormatter: [utils.toHex], inputFormatter: [formatters.inputBlockNumberFormatter],
outputFormatter: utils.toDecimal outputFormatter: utils.toDecimal
}); });

View File

@ -17,6 +17,12 @@ var tests = [{
result: '0xb', result: '0xb',
formattedResult: 11, formattedResult: 11,
call: 'eth_getBlockTransactionCountByNumber' call: 'eth_getBlockTransactionCountByNumber'
},{
args: ['pending'],
formattedArgs: ['pending'],
result: '0xb',
formattedResult: 11,
call: 'eth_getBlockTransactionCountByNumber'
}]; }];
testMethod.runTests('eth', method, tests); testMethod.runTests('eth', method, tests);

View File

@ -16,6 +16,12 @@ var tests = [{
result: '0xb', result: '0xb',
formattedResult: 11, formattedResult: 11,
call: 'eth_getUncleCountByBlockNumber' call: 'eth_getUncleCountByBlockNumber'
},{
args: ['pending'],
formattedArgs: ['pending'],
result: '0xb',
formattedResult: 11,
call: 'eth_getUncleCountByBlockNumber'
}]; }];
testMethod.runTests('eth', method, tests); testMethod.runTests('eth', method, tests);