aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-08-13 10:23:29 +0800
committerJacob Evans <jacob@dekz.net>2018-08-15 11:06:32 +0800
commit622509c508272790e3e69c09cf1a1f9696815147 (patch)
tree0a86370cc0e02a2ede06e48baa5ad123d0617276 /packages/contracts/test/utils/fill_order_combinatorial_utils.ts
parentf9f232f5d9527926cd64027f69491b0bc6e58894 (diff)
downloaddexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar.gz
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar.bz2
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar.lz
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar.xz
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.tar.zst
dexon-sol-tools-622509c508272790e3e69c09cf1a1f9696815147.zip
[Order-utils] Order is valid when maker amount is very small
Previously our min fillable calculation would throw a rounding error when encountering a valid order (with a small maker amount). This was inconsistent with the on-chain logic which allowed this order to be filled.
Diffstat (limited to 'packages/contracts/test/utils/fill_order_combinatorial_utils.ts')
-rw-r--r--packages/contracts/test/utils/fill_order_combinatorial_utils.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
index 284c4a2db..f18ad0dd3 100644
--- a/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
+++ b/packages/contracts/test/utils/fill_order_combinatorial_utils.ts
@@ -81,6 +81,12 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
erc20FiveDecimalTokenCount,
fiveDecimals,
);
+ const zeroDecimals = new BigNumber(0);
+ const erc20ZeroDecimalTokenCount = 2;
+ const [erc20ZeroDecimalTokenA, erc20ZeroDecimalTokenB] = await erc20Wrapper.deployDummyTokensAsync(
+ erc20ZeroDecimalTokenCount,
+ zeroDecimals,
+ );
const erc20Proxy = await erc20Wrapper.deployProxyAsync();
await erc20Wrapper.setBalancesAndAllowancesAsync();
@@ -119,6 +125,7 @@ export async function fillOrderCombinatorialUtilsFactoryAsync(
zrxToken.address,
[erc20EighteenDecimalTokenA.address, erc20EighteenDecimalTokenB.address],
[erc20FiveDecimalTokenA.address, erc20FiveDecimalTokenB.address],
+ [erc20ZeroDecimalTokenA.address, erc20ZeroDecimalTokenB.address],
erc721Token,
erc721Balances,
exchangeContract.address,