Skip to content

Commit

Permalink
internal/jsre: add inputBlockNumberOrHashFormatter
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <[email protected]>
  • Loading branch information
jsvisa committed Aug 7, 2023
1 parent 7d6c8e1 commit 2bb8cfd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/jsre/deps/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -3706,6 +3706,13 @@ var inputDefaultBlockNumberFormatter = function (blockNumber) {
return inputBlockNumberFormatter(blockNumber);
};

var inputBlockNumberOrHashFormatter = function (numberOrHash) {
if (utils.isString(numberOrHash) && numberOrHash.indexOf('0x') === 0) {
return numberOrHash;
}
return inputBlockNumberFormatter(numberOrHash);
};

var inputBlockNumberFormatter = function (blockNumber) {
if (blockNumber === undefined) {
return undefined;
Expand Down

0 comments on commit 2bb8cfd

Please sign in to comment.