internal/web3ext: improve eth_getBlockByNumber and eth_getBlockByHash console api (#21608)

This commit is contained in:
mr_franklin 2020-09-28 20:28:38 +08:00 committed by GitHub
parent eebfb13053
commit a04294d160
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -532,12 +532,14 @@ web3._extend({
new web3._extend.Method({ new web3._extend.Method({
name: 'getBlockByNumber', name: 'getBlockByNumber',
call: 'eth_getBlockByNumber', call: 'eth_getBlockByNumber',
params: 2 params: 2,
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, function (val) { return !!val; }]
}), }),
new web3._extend.Method({ new web3._extend.Method({
name: 'getBlockByHash', name: 'getBlockByHash',
call: 'eth_getBlockByHash', call: 'eth_getBlockByHash',
params: 2 params: 2,
inputFormatter: [null, function (val) { return !!val; }]
}), }),
new web3._extend.Method({ new web3._extend.Method({
name: 'getRawTransaction', name: 'getRawTransaction',