Upgrade chai-bignumber
This commit is contained in:
parent
c3afc13dd6
commit
eb393f0a66
@ -45,7 +45,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereum-types": "^1.1.6",
|
"ethereum-types": "^1.1.6",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
"@types/yargs": "^10.0.0",
|
"@types/yargs": "^10.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ethereumjs-abi": "0.6.5",
|
"ethereumjs-abi": "0.6.5",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"awesome-typescript-loader": "^5.2.1",
|
"awesome-typescript-loader": "^5.2.1",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"copyfiles": "^2.0.0",
|
"copyfiles": "^2.0.0",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
"@types/web3-provider-engine": "^14.0.0",
|
"@types/web3-provider-engine": "^14.0.0",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -121,7 +121,10 @@ export const assetUtils = {
|
|||||||
error.amountAvailableToFill,
|
error.amountAvailableToFill,
|
||||||
asset.metaData.decimals,
|
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)) {
|
if (roundedUnitAmountAvailableToFill.isGreaterThan(BIG_NUMBER_ZERO)) {
|
||||||
return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`;
|
return `There are only ${roundedUnitAmountAvailableToFill} ${assetName} available to buy`;
|
||||||
|
@ -25,7 +25,7 @@ export const format = {
|
|||||||
if (_.isUndefined(ethUnitAmount)) {
|
if (_.isUndefined(ethUnitAmount)) {
|
||||||
return defaultText;
|
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)) {
|
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
|
// Sometimes for small ETH amounts (i.e. 0.000045) the amount rounded to 4 decimalPlaces is 0
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
"@0x/sol-compiler": "^2.0.2",
|
"@0x/sol-compiler": "^2.0.2",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"npm-run-all": "^4.1.2",
|
"npm-run-all": "^4.1.2",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
"@types/sinon": "^2.2.2",
|
"@types/sinon": "^2.2.2",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
"@types/mocha": "^2.2.42",
|
"@types/mocha": "^2.2.42",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
"mocha": "^4.1.0",
|
"mocha": "^4.1.0",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"@types/lodash": "4.14.104",
|
"@types/lodash": "4.14.104",
|
||||||
"chai": "^4.0.1",
|
"chai": "^4.0.1",
|
||||||
"chai-as-promised": "^7.1.0",
|
"chai-as-promised": "^7.1.0",
|
||||||
"chai-bignumber": "^2.0.1",
|
"chai-bignumber": "^2.0.2",
|
||||||
"dirty-chai": "^2.0.1",
|
"dirty-chai": "^2.0.1",
|
||||||
"ganache-core": "0xProject/ganache-core#monorepo-dep",
|
"ganache-core": "0xProject/ganache-core#monorepo-dep",
|
||||||
"make-promises-safe": "^1.1.0",
|
"make-promises-safe": "^1.1.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user