Skip to content

Commit a04294d

Browse files
authored
internal/web3ext: improve eth_getBlockByNumber and eth_getBlockByHash console api (#21608)
1 parent eebfb13 commit a04294d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎internal/web3ext/web3ext.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,14 @@ web3._extend({
532532
new web3._extend.Method({
533533
name: 'getBlockByNumber',
534534
call: 'eth_getBlockByNumber',
535-
params: 2
535+
params: 2,
536+
inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, function (val) { return !!val; }]
536537
}),
537538
new web3._extend.Method({
538539
name: 'getBlockByHash',
539540
call: 'eth_getBlockByHash',
540-
params: 2
541+
params: 2,
542+
inputFormatter: [null, function (val) { return !!val; }]
541543
}),
542544
new web3._extend.Method({
543545
name: 'getRawTransaction',

0 commit comments

Comments
 (0)