aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/instant/src/components/buy_button.tsx2
-rw-r--r--packages/instant/src/containers/selected_asset_buy_button.ts5
-rw-r--r--packages/instant/src/types.ts2
3 files changed, 5 insertions, 4 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx
index 841a9593b..6fe333dc7 100644
--- a/packages/instant/src/components/buy_button.tsx
+++ b/packages/instant/src/components/buy_button.tsx
@@ -15,7 +15,7 @@ export interface BuyButtonProps {
onSignatureDenied: (buyQuote: BuyQuote, preventedError: Error) => void;
onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void;
onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
- onBuyFailure: (buyQuote: BuyQuote, txHash?: string) => void; // TODO: make this non-optional
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void;
}
export class BuyButton extends React.Component<BuyButtonProps> {
diff --git a/packages/instant/src/containers/selected_asset_buy_button.ts b/packages/instant/src/containers/selected_asset_buy_button.ts
index 8d60715be..adcbd61bc 100644
--- a/packages/instant/src/containers/selected_asset_buy_button.ts
+++ b/packages/instant/src/containers/selected_asset_buy_button.ts
@@ -22,7 +22,7 @@ interface ConnectedDispatch {
onSignatureDenied: (buyQuote: BuyQuote, error: Error) => void;
onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void;
onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void;
- onBuyFailure: (buyQuote: BuyQuote) => void;
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void;
}
const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyButtonProps): ConnectedState => ({
@@ -41,7 +41,8 @@ const mapDispatchToProps = (dispatch: Dispatch<Action>, ownProps: SelectedAssetB
},
onBuySuccess: (buyQuote: BuyQuote, txHash: string) =>
dispatch(actions.updateBuyOrderState({ processState: OrderProcessState.SUCCESS, txHash })),
- onBuyFailure: buyQuote => dispatch(actions.updateBuyOrderState({ processState: OrderProcessState.FAILURE })),
+ onBuyFailure: (buyQuote: BuyQuote, txHash: string) =>
+ dispatch(actions.updateBuyOrderState({ processState: OrderProcessState.FAILURE, txHash })),
onSignatureDenied: (buyQuote, error) => {
dispatch(actions.resetAmount());
dispatch(actions.setError(error));
diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts
index 255aee1eb..ad8794c94 100644
--- a/packages/instant/src/types.ts
+++ b/packages/instant/src/types.ts
@@ -29,7 +29,7 @@ interface SuccessfulOrderState {
}
interface FailureOrderState {
processState: OrderProcessState.FAILURE;
- txHash?: string;
+ txHash: string;
}
export type OrderState = RegularOrderState | ProcessingOrderState | SuccessfulOrderState | FailureOrderState;