aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/test/order_watcher_test.ts
diff options
context:
space:
mode:
authorF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-08-17 06:32:09 +0800
committerGitHub <noreply@github.com>2018-08-17 06:32:09 +0800
commitc1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b (patch)
tree919eca787e6da6b6e1b28073d7a9e876f9497616 /packages/order-watcher/test/order_watcher_test.ts
parent445177bf420049041ade4d7526a5f4a8194bd216 (diff)
parent72752bcb68bac29ff5897ed57de357ad7af09abe (diff)
downloaddexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar.gz
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar.bz2
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar.lz
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar.xz
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.tar.zst
dexon-sol-tools-c1ec849554a1e55cd3e8d5bbee206f4bf1d67a5b.zip
Merge branch 'development' into sol-compile-lot
Diffstat (limited to 'packages/order-watcher/test/order_watcher_test.ts')
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts20
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts
index 00962bed0..38bfde7ef 100644
--- a/packages/order-watcher/test/order_watcher_test.ts
+++ b/packages/order-watcher/test/order_watcher_test.ts
@@ -501,25 +501,27 @@ describe('OrderWatcher', () => {
expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid;
expect(invalidOrderState.orderHash).to.be.equal(orderHash);
- expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderFillRoundingError);
+ expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderCancelled);
});
orderWatcher.subscribe(callback);
await contractWrappers.exchange.cancelOrderAsync(signedOrder);
})().catch(done);
});
- it('should emit orderStateInvalid when within rounding error range', (done: DoneCallback) => {
+ it('should emit orderStateInvalid when within rounding error range after a partial fill', (done: DoneCallback) => {
(async () => {
- const remainingFillableAmountInBaseUnits = new BigNumber(100);
- signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ const fillAmountInBaseUnits = new BigNumber(2);
+ const makerAssetAmount = new BigNumber(1001);
+ const takerAssetAmount = new BigNumber(3);
+ signedOrder = await fillScenarios.createAsymmetricFillableSignedOrderAsync(
makerAssetData,
takerAssetData,
makerAddress,
takerAddress,
- fillableAmount,
+ makerAssetAmount,
+ takerAssetAmount,
);
const orderHash = orderHashUtils.getOrderHashHex(signedOrder);
await orderWatcher.addOrderAsync(signedOrder);
-
const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => {
expect(orderState.isValid).to.be.false();
const invalidOrderState = orderState as OrderStateInvalid;
@@ -527,11 +529,7 @@ describe('OrderWatcher', () => {
expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderFillRoundingError);
});
orderWatcher.subscribe(callback);
- await contractWrappers.exchange.fillOrderAsync(
- signedOrder,
- fillableAmount.minus(remainingFillableAmountInBaseUnits),
- takerAddress,
- );
+ await contractWrappers.exchange.fillOrderAsync(signedOrder, fillAmountInBaseUnits, takerAddress);
})().catch(done);
});
describe('erc721', () => {