diff options
author | Fabio Berger <me@fabioberger.com> | 2018-11-09 07:45:48 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-11-09 07:45:48 +0800 |
commit | 857a35d4f71c1c954033c3b0505250e18be21cfb (patch) | |
tree | 47dc81508fe8d71b0c0acfcd24b36fa8455c6ae6 /packages/order-utils/src/abstract | |
parent | 8b06b3627426c3f9eda3262d0b6479d55cc4c9ad (diff) | |
download | dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.gz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.bz2 dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.lz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.xz dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.tar.zst dexon-sol-tools-857a35d4f71c1c954033c3b0505250e18be21cfb.zip |
Fix validateOrderFillableOrThrowAsync method so it also checks order signature, cancelled, cancelledUpTo, and throws helpful error messages
Diffstat (limited to 'packages/order-utils/src/abstract')
-rw-r--r-- | packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts | 3 | ||||
-rw-r--r-- | packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts index de096b7d9..9e240f9ef 100644 --- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts +++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_fetcher.ts @@ -1,3 +1,4 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; /** @@ -17,6 +18,6 @@ export abstract class AbstractOrderFilledCancelledFetcher { * @param orderHash OrderHash of order we are interested in * @return Whether or not the order is cancelled */ - public abstract async isOrderCancelledAsync(orderHash: string): Promise<boolean>; + public abstract async isOrderCancelledAsync(signedOrder: SignedOrder): Promise<boolean>; public abstract getZRXAssetData(): string; } diff --git a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts index d9e66db06..186521401 100644 --- a/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts +++ b/packages/order-utils/src/abstract/abstract_order_filled_cancelled_lazy_store.ts @@ -1,8 +1,9 @@ +import { SignedOrder } from '@0x/types'; import { BigNumber } from '@0x/utils'; export abstract class AbstractOrderFilledCancelledLazyStore { public abstract async getFilledTakerAmountAsync(orderHash: string): Promise<BigNumber>; - public abstract async getIsCancelledAsync(orderHash: string): Promise<boolean>; + public abstract async getIsCancelledAsync(signedOrder: SignedOrder): Promise<boolean>; public abstract setFilledTakerAmount(orderHash: string, balance: BigNumber): void; public abstract deleteFilledTakerAmount(orderHash: string): void; public abstract setIsCancelled(orderHash: string, isCancelled: boolean): void; |