From a04294d1607d0526002770cdc93bed73ee78a3a5 Mon Sep 17 00:00:00 2001 From: mr_franklin Date: Mon, 28 Sep 2020 20:28:38 +0800 Subject: [PATCH] internal/web3ext: improve eth_getBlockByNumber and eth_getBlockByHash console api (#21608) --- internal/web3ext/web3ext.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index e2b8ad171..20e0ea11f 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -532,12 +532,14 @@ web3._extend({ new web3._extend.Method({ name: 'getBlockByNumber', call: 'eth_getBlockByNumber', - params: 2 + params: 2, + inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, function (val) { return !!val; }] }), new web3._extend.Method({ name: 'getBlockByHash', call: 'eth_getBlockByHash', - params: 2 + params: 2, + inputFormatter: [null, function (val) { return !!val; }] }), new web3._extend.Method({ name: 'getRawTransaction',