aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-watcher/test
diff options
context:
space:
mode:
authorF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-09-26 04:34:44 +0800
committerF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-09-26 04:34:44 +0800
commitd3edb9721c21a00c40f03d5c270f19c0d9954754 (patch)
treefed69dbc80245c77af28ccc5f7c170ac8e726c7c /packages/order-watcher/test
parentde9f5d350f008f1eeb6e42a3dcf611262f6210b4 (diff)
parentb40861747b73bb9a0826853751b7caa5cbf085ae (diff)
downloaddexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar.gz
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar.bz2
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar.lz
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar.xz
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.tar.zst
dexon-sol-tools-d3edb9721c21a00c40f03d5c270f19c0d9954754.zip
Merge remote-tracking branch 'upstream/development' into sol-doc
Diffstat (limited to 'packages/order-watcher/test')
-rw-r--r--packages/order-watcher/test/order_watcher_test.ts26
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts
index 38bfde7ef..60d9069e8 100644
--- a/packages/order-watcher/test/order_watcher_test.ts
+++ b/packages/order-watcher/test/order_watcher_test.ts
@@ -250,6 +250,32 @@ describe('OrderWatcher', () => {
await contractWrappers.exchange.fillOrderAsync(signedOrder, fillableAmount, takerAddress);
})().catch(done);
});
+ it('should include transactionHash in emitted orderStateInvalid when watched order fully filled', (done: DoneCallback) => {
+ (async () => {
+ signedOrder = await fillScenarios.createFillableSignedOrderAsync(
+ makerAssetData,
+ takerAssetData,
+ makerAddress,
+ takerAddress,
+ fillableAmount,
+ );
+ await orderWatcher.addOrderAsync(signedOrder);
+
+ let transactionHash: string;
+ const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => {
+ expect(orderState.isValid).to.be.false();
+ const invalidOrderState = orderState as OrderStateInvalid;
+ expect(invalidOrderState.transactionHash).to.be.equal(transactionHash);
+ });
+ orderWatcher.subscribe(callback);
+
+ transactionHash = await contractWrappers.exchange.fillOrderAsync(
+ signedOrder,
+ fillableAmount,
+ takerAddress,
+ );
+ })().catch(done);
+ });
it('should emit orderStateValid when watched order partially filled', (done: DoneCallback) => {
(async () => {
signedOrder = await fillScenarios.createFillableSignedOrderAsync(