aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:21:24 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-11-13 09:21:24 +0800
commite512e38efbbec030add83ce2bc50f0d17862bdd6 (patch)
treea85a712d3a478199a09ac6aebac6e43d2e3f3c3a
parent7ea0b138bc7a61037636eb5b4d2ad9b995a27f79 (diff)
downloaddexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar.gz
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar.bz2
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar.lz
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar.xz
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.tar.zst
dexon-sol-tools-e512e38efbbec030add83ce2bc50f0d17862bdd6.zip
Remove old tests
-rw-r--r--test/order_state_watcher_test.ts62
1 files changed, 0 insertions, 62 deletions
diff --git a/test/order_state_watcher_test.ts b/test/order_state_watcher_test.ts
index 2b1aa68b7..c8a4a8064 100644
--- a/test/order_state_watcher_test.ts
+++ b/test/order_state_watcher_test.ts
@@ -352,67 +352,5 @@ describe('OrderStateWatcher', () => {
await zeroEx.exchange.cancelOrderAsync(signedOrder, cancelAmountInBaseUnits);
})().catch(done);
});
- describe('check numConfirmations behavior', () => {
- before(() => {
- const configs: ZeroExConfig = {
- orderWatcherConfig: {
- numConfirmations: 1,
- },
- };
- zeroEx = new ZeroEx(web3.currentProvider, configs);
- });
- it('should emit orderState when watching at 1 confirmation deep and event is one block deep',
- (done: DoneCallback) => {
- (async () => {
- fillScenarios = new FillScenarios(
- zeroEx, userAddresses, tokens, zrxTokenAddress, exchangeContractAddress,
- );
-
- signedOrder = await fillScenarios.createFillableSignedOrderAsync(
- makerToken.address, takerToken.address, maker, taker, fillableAmount,
- );
- const orderHash = ZeroEx.getOrderHashHex(signedOrder);
- zeroEx.orderStateWatcher.addOrder(signedOrder);
- const callback = reportCallbackErrors(done)((orderState: OrderState) => {
- 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.InsufficientMakerBalance);
- done();
- });
- zeroEx.orderStateWatcher.subscribe(callback);
-
- const anyRecipient = taker;
- const makerBalance = await zeroEx.token.getBalanceAsync(makerToken.address, maker);
- await zeroEx.token.transferAsync(makerToken.address, maker, anyRecipient, makerBalance);
- blockchainLifecycle.mineABlock();
- })().catch(done);
- });
- it('shouldn\'t emit orderState when watching at 1 confirmation deep and event is in mempool',
- (done: DoneCallback) => {
- (async () => {
- fillScenarios = new FillScenarios(
- zeroEx, userAddresses, tokens, zrxTokenAddress, exchangeContractAddress,
- );
-
- signedOrder = await fillScenarios.createFillableSignedOrderAsync(
- makerToken.address, takerToken.address, maker, taker, fillableAmount,
- );
- const orderHash = ZeroEx.getOrderHashHex(signedOrder);
- zeroEx.orderStateWatcher.addOrder(signedOrder);
- const callback = reportCallbackErrors(done)((orderState: OrderState) => {
- throw new Error('OrderState callback fired when it shouldn\'t have');
- });
- zeroEx.orderStateWatcher.subscribe(callback);
-
- const anyRecipient = taker;
- const makerBalance = await zeroEx.token.getBalanceAsync(makerToken.address, maker);
- await zeroEx.token.transferAsync(makerToken.address, maker, anyRecipient, makerBalance);
- setTimeout(() => {
- done();
- }, TIMEOUT_MS);
- })().catch(done);
- });
- });
});
});