web3-utils
Advanced tools
Comparing version 1.7.4-rc.0 to 1.7.4-rc.1
@@ -472,4 +472,15 @@ /* | ||
}; | ||
// 1.x currently accepts 0x... strings, bn.js after update doesn't. it would be a breaking change | ||
var BNwrapped = function (value) { | ||
// check negative | ||
if (typeof value == "string" && value.includes("0x")) { | ||
const [negative, hexValue] = value.toLocaleLowerCase().startsWith('-') ? ["-", value.slice(3)] : ["", value.slice(2)]; | ||
return new BN(negative + hexValue, 16); | ||
} | ||
else { | ||
return new BN(value); | ||
} | ||
}; | ||
module.exports = { | ||
BN: BN, | ||
BN: BNwrapped, | ||
isBN: isBN, | ||
@@ -476,0 +487,0 @@ isBigNumber: isBigNumber, |
{ | ||
"name": "web3-utils", | ||
"version": "1.7.4-rc.0", | ||
"version": "1.7.4-rc.1", | ||
"description": "Collection of utility functions used in web3.js.", | ||
@@ -17,3 +17,3 @@ "repository": "https://github.com/ethereum/web3.js/tree/1.x/packages/web3-utils", | ||
"dependencies": { | ||
"bn.js": "^4.11.9", | ||
"bn.js": "^5.2.1", | ||
"ethereum-bloom-filters": "^1.0.6", | ||
@@ -30,3 +30,3 @@ "ethereumjs-util": "^7.1.0", | ||
}, | ||
"gitHead": "e3b2e8eadbdf825acfbd5c4cbb5d0ee7e1540307" | ||
"gitHead": "a286ab3a0a7866b88c206fd3d6f17033209f52a8" | ||
} |
@@ -537,4 +537,16 @@ /* | ||
// 1.x currently accepts 0x... strings, bn.js after update doesn't. it would be a breaking change | ||
var BNwrapped = function (value) { | ||
// check negative | ||
if (typeof value == "string" && value.includes("0x")) { | ||
const [negative, hexValue] = value.toLocaleLowerCase().startsWith('-') ? ["-", value.slice(3)] : ["", value.slice(2)]; | ||
return new BN(negative + hexValue, 16); | ||
} | ||
else { | ||
return new BN(value); | ||
} | ||
}; | ||
module.exports = { | ||
BN: BN, | ||
BN: BNwrapped, | ||
isBN: isBN, | ||
@@ -541,0 +553,0 @@ isBigNumber: isBigNumber, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165305
4833
Updatedbn.js@^5.2.1