diff --git a/console/jsre/deps/web3.js b/console/jsre/deps/web3.js index 2077d9f44..745e30fed 100644 --- a/console/jsre/deps/web3.js +++ b/console/jsre/deps/web3.js @@ -3848,8 +3848,10 @@ var inputBlockNumberFormatter = function (blockNumber) { return undefined; } else if (isPredefinedBlockNumber(blockNumber)) { return blockNumber; + } else if (/^\d+$/.test(blockNumber) || /^0x[0-9a-fA-F]+$/.test(blockNumber)) { // test if input is decmial or hex + return utils.toHex(blockNumber); } - return utils.toHex(blockNumber); + throw new Error(`input block number(${blockNumber}) is invalid`); }; var inputEmptyFormatter = function (a) {