Upgrade chai-bignumber

This commit is contained in:
Leonid Logvinov 2019-01-14 15:53:43 +01:00
parent c3afc13dd6
commit eb393f0a66
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
18 changed files with 21 additions and 18 deletions

View File

@ -45,7 +45,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -57,7 +57,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -56,7 +56,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -57,7 +57,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -55,7 +55,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -61,7 +61,7 @@
"bn.js": "^4.11.8",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereum-types": "^1.1.6",
"ethereumjs-abi": "0.6.5",

View File

@ -56,7 +56,7 @@
"@types/yargs": "^10.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -57,7 +57,7 @@
"bn.js": "^4.11.8",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ethereumjs-abi": "0.6.5",
"make-promises-safe": "^1.1.0",

View File

@ -54,7 +54,7 @@
"awesome-typescript-loader": "^5.2.1",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",

View File

@ -56,7 +56,7 @@
"@types/node": "*",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -49,7 +49,7 @@
"@types/web3-provider-engine": "^14.0.0",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -121,7 +121,10 @@ export const assetUtils = {
error.amountAvailableToFill,
asset.metaData.decimals,
);
const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.integerValue(2, BigNumber.ROUND_DOWN);
const roundedUnitAmountAvailableToFill = unitAmountAvailableToFill.decimalPlaces(
2,
BigNumber.ROUND_DOWN,
);
if (roundedUnitAmountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO)) {
return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`;

View File

@ -25,7 +25,7 @@ export const format = {
if (_.isUndefined(ethUnitAmount)) {
return defaultText;
}
let roundedAmount = ethUnitAmount.integerValue(decimalPlaces).toDigits(decimalPlaces);
let roundedAmount = ethUnitAmount.decimalPlaces(decimalPlaces).precision(decimalPlaces);
if (roundedAmount.eq(BIG_NUMBER_ZERO) && ethUnitAmount.isGreaterThan(BIG_NUMBER_ZERO)) {
// Sometimes for small ETH amounts (i.e. 0.000045) the amount rounded to 4 decimalPlaces is 0

View File

@ -53,7 +53,7 @@
"@0x/sol-compiler": "^2.0.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"npm-run-all": "^4.1.2",

View File

@ -41,7 +41,7 @@
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -44,7 +44,7 @@
"@types/sinon": "^2.2.2",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -34,7 +34,7 @@
"@types/mocha": "^2.2.42",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"make-promises-safe": "^1.1.0",
"mocha": "^4.1.0",

View File

@ -41,7 +41,7 @@
"@types/lodash": "4.14.104",
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
"chai-bignumber": "^2.0.2",
"dirty-chai": "^2.0.1",
"ganache-core": "0xProject/ganache-core#monorepo-dep",
"make-promises-safe": "^1.1.0",