From 5c6155f9f49bfef173c4107979185aec59806c38 Mon Sep 17 00:00:00 2001 From: mr_franklin Date: Tue, 13 Oct 2020 19:24:08 +0800 Subject: [PATCH] internal/web3ext: improve some web3 apis (#21639) * imporve some web3-ext apis * Update web3ext.go Co-authored-by: Felix Lange --- internal/web3ext/web3ext.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/web3ext/web3ext.go b/internal/web3ext/web3ext.go index 20e0ea11f..77954bbbf 100644 --- a/internal/web3ext/web3ext.go +++ b/internal/web3ext/web3ext.go @@ -237,7 +237,8 @@ web3._extend({ new web3._extend.Method({ name: 'printBlock', call: 'debug_printBlock', - params: 1 + params: 1, + outputFormatter: console.log }), new web3._extend.Method({ name: 'getBlockRlp', @@ -248,7 +249,7 @@ web3._extend({ name: 'testSignCliqueBlock', call: 'debug_testSignCliqueBlock', params: 2, - inputFormatters: [web3._extend.formatters.inputAddressFormatter, null], + inputFormatter: [web3._extend.formatters.inputAddressFormatter, null], }), new web3._extend.Method({ name: 'setHead', @@ -263,7 +264,8 @@ web3._extend({ new web3._extend.Method({ name: 'dumpBlock', call: 'debug_dumpBlock', - params: 1 + params: 1, + inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] }), new web3._extend.Method({ name: 'chaindbProperty', @@ -415,7 +417,7 @@ web3._extend({ name: 'traceBlockByNumber', call: 'debug_traceBlockByNumber', params: 2, - inputFormatter: [null, null] + inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter, null] }), new web3._extend.Method({ name: 'traceBlockByHash', @@ -522,7 +524,8 @@ web3._extend({ new web3._extend.Method({ name: 'getHeaderByNumber', call: 'eth_getHeaderByNumber', - params: 1 + params: 1, + inputFormatter: [web3._extend.formatters.inputBlockNumberFormatter] }), new web3._extend.Method({ name: 'getHeaderByHash',