aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-08-17 06:10:12 +0800
committerFabio Berger <me@fabioberger.com>2018-08-17 06:10:12 +0800
commit0337b5a40104ef83ebd527184785def7f399d573 (patch)
tree1fcbd0effd3ad4a88e99a41082825818e3f02302 /packages/order-watcher
parente47e9c5b34a2c189b6913c4c7082cb7ec256617f (diff)
parent72752bcb68bac29ff5897ed57de357ad7af09abe (diff)
downloaddexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar.gz
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar.bz2
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar.lz
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar.xz
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.tar.zst
dexon-sol-tools-0337b5a40104ef83ebd527184785def7f399d573.zip
Merge development
Diffstat (limited to 'packages/order-watcher')
-rw-r--r--packages/order-watcher/package.json4
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts20
2 files changed, 11 insertions, 13 deletions
diff --git a/packages/order-watcher/package.json b/packages/order-watcher/package.json
index ad3570533..4d719e575 100644
--- a/packages/order-watcher/package.json
+++ b/packages/order-watcher/package.json
@@ -58,7 +58,7 @@
"chai": "^4.0.1",
"chai-as-promised": "^7.1.0",
"chai-bignumber": "^2.0.1",
- "copyfiles": "^1.2.0",
+ "copyfiles": "^2.0.0",
"dirty-chai": "^2.0.1",
"json-loader": "^0.5.4",
"make-promises-safe": "^1.1.0",
@@ -70,7 +70,7 @@
"sinon": "^4.0.0",
"source-map-support": "^0.5.0",
"tslint": "5.11.0",
- "typescript": "2.9.2"
+ "typescript": "3.0.1"
},
"dependencies": {
"@0xproject/assert": "^1.0.5",
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', () => {