From e55d8802e10afd20791aafd2b0958b674f9c0408 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Thu, 25 Oct 2018 13:53:35 -0700 Subject: Rework OrderState to have more simple definition --- packages/instant/src/types.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'packages') diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts index ad8794c94..63b49cb26 100644 --- a/packages/instant/src/types.ts +++ b/packages/instant/src/types.ts @@ -16,22 +16,14 @@ export enum OrderProcessState { FAILURE = 'Failure', } -interface RegularOrderState { +interface OrderStateWithoutTx { processState: OrderProcessState.NONE | OrderProcessState.AWAITING_SIGNATURE; } -interface ProcessingOrderState { - processState: OrderProcessState.PROCESSING; +interface OrderStateWithTx { + processState: OrderProcessState.PROCESSING | OrderProcessState.SUCCESS | OrderProcessState.FAILURE; txHash: string; } -interface SuccessfulOrderState { - processState: OrderProcessState.SUCCESS; - txHash: string; -} -interface FailureOrderState { - processState: OrderProcessState.FAILURE; - txHash: string; -} -export type OrderState = RegularOrderState | ProcessingOrderState | SuccessfulOrderState | FailureOrderState; +export type OrderState = OrderStateWithoutTx | OrderStateWithTx; export enum DisplayStatus { Present, -- cgit