diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-07 06:26:40 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-07 06:26:40 +0800 |
commit | a97d77064aacda3de74b04894f110b05298c5ca8 (patch) | |
tree | fa8cfc4b0bf65b065fd2c7acc2691b1b2c6261bd /packages/order-watcher/test | |
parent | 6a2da6dc06c616ba50930bbe04a6fa200885ecfd (diff) | |
download | dexon-0x-contracts-a97d77064aacda3de74b04894f110b05298c5ca8.tar.gz dexon-0x-contracts-a97d77064aacda3de74b04894f110b05298c5ca8.tar.zst dexon-0x-contracts-a97d77064aacda3de74b04894f110b05298c5ca8.zip |
Get build and tests to pass
Diffstat (limited to 'packages/order-watcher/test')
-rw-r--r-- | packages/order-watcher/test/order_watcher_test.ts | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/packages/order-watcher/test/order_watcher_test.ts b/packages/order-watcher/test/order_watcher_test.ts index d8c918f16..c2161ada6 100644 --- a/packages/order-watcher/test/order_watcher_test.ts +++ b/packages/order-watcher/test/order_watcher_test.ts @@ -1,8 +1,9 @@ +// tslint:disable:no-unnecessary-type-assertion import { ContractWrappers } from '@0xproject/contract-wrappers'; import { BlockchainLifecycle, callbackErrorReporter } from '@0xproject/dev-utils'; import { FillScenarios } from '@0xproject/fill-scenarios'; import { getOrderHashHex } from '@0xproject/order-utils'; -import { DoneCallback, ExchangeContractErrs, OrderState, SignedOrder, Token } from '@0xproject/types'; +import { DoneCallback, ExchangeContractErrs, OrderState, OrderStateInvalid, SignedOrder, Token, OrderStateValid } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import { Web3Wrapper } from '@0xproject/web3-wrapper'; import * as chai from 'chai'; @@ -132,7 +133,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState; + const invalidOrderState = orderState as OrderStateInvalid; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerAllowance); }); @@ -181,7 +182,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState; + const invalidOrderState = orderState as OrderStateInvalid; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.InsufficientMakerBalance); }); @@ -205,7 +206,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState; + const invalidOrderState = orderState as OrderStateInvalid; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderRemainingFillAmountZero); }); @@ -237,7 +238,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; const remainingMakerBalance = makerBalance.sub(fillAmountInBaseUnits); @@ -298,7 +299,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( @@ -332,7 +333,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( changedMakerApprovalAmount, @@ -367,7 +368,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingAmount, @@ -407,7 +408,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingTokenAmount, @@ -440,7 +441,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( remainingFeeAmount, @@ -475,7 +476,7 @@ describe('OrderWatcher', () => { orderWatcher.addOrder(signedOrder); const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.remainingFillableMakerTokenAmount).to.be.bignumber.equal( fillableAmount, @@ -504,7 +505,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState; + const invalidOrderState = orderState as OrderStateInvalid; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderRemainingFillAmountZero); }); @@ -528,7 +529,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.false(); - const invalidOrderState = orderState; + const invalidOrderState = orderState as OrderStateInvalid; expect(invalidOrderState.orderHash).to.be.equal(orderHash); expect(invalidOrderState.error).to.be.equal(ExchangeContractErrs.OrderFillRoundingError); }); @@ -555,7 +556,7 @@ describe('OrderWatcher', () => { const callback = callbackErrorReporter.reportNodeCallbackErrors(done)((orderState: OrderState) => { expect(orderState.isValid).to.be.true(); - const validOrderState = orderState; + const validOrderState = orderState as OrderStateValid; expect(validOrderState.orderHash).to.be.equal(orderHash); const orderRelevantState = validOrderState.orderRelevantState; expect(orderRelevantState.cancelledTakerTokenAmount).to.be.bignumber.equal(cancelAmountInBaseUnits); |