diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 04:32:37 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 04:32:37 +0800 |
commit | c5e8bb17635d8710f0db62a8887f990cb6ad482f (patch) | |
tree | 7850c2f522aca88b327a8cdcbe07ce80f1109fc3 /packages/instant/src/components/buy_button.tsx | |
parent | acefeff5f08f123c7c5d372088f2af016e31c599 (diff) | |
download | dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.gz dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.tar.zst dexon-0x-contracts-c5e8bb17635d8710f0db62a8887f990cb6ad482f.zip |
txnHash -> txHash
Diffstat (limited to 'packages/instant/src/components/buy_button.tsx')
-rw-r--r-- | packages/instant/src/components/buy_button.tsx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/instant/src/components/buy_button.tsx b/packages/instant/src/components/buy_button.tsx index 7004b6a18..841a9593b 100644 --- a/packages/instant/src/components/buy_button.tsx +++ b/packages/instant/src/components/buy_button.tsx @@ -13,9 +13,9 @@ export interface BuyButtonProps { assetBuyer?: AssetBuyer; onAwaitingSignature: (buyQuote: BuyQuote) => void; onSignatureDenied: (buyQuote: BuyQuote, preventedError: Error) => void; - onBuyProcessing: (buyQuote: BuyQuote, txnHash: string) => void; - onBuySuccess: (buyQuote: BuyQuote, txnHash: string) => void; - onBuyFailure: (buyQuote: BuyQuote, txnHash?: string) => void; // TODO: make this non-optional + onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void; + onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void; + onBuyFailure: (buyQuote: BuyQuote, txHash?: string) => void; // TODO: make this non-optional } export class BuyButton extends React.Component<BuyButtonProps> { @@ -41,10 +41,10 @@ export class BuyButton extends React.Component<BuyButtonProps> { return; } - let txnHash: string | undefined; + let txHash: string | undefined; this.props.onAwaitingSignature(buyQuote); try { - txnHash = await assetBuyer.executeBuyQuoteAsync(buyQuote); + txHash = await assetBuyer.executeBuyQuoteAsync(buyQuote); } catch (e) { if (e instanceof Error && e.message === AssetBuyerError.SignatureRequestDenied) { this.props.onSignatureDenied(buyQuote, e); @@ -54,20 +54,20 @@ export class BuyButton extends React.Component<BuyButtonProps> { } // Have to let TS know that txHash is definitely defined now - if (!txnHash) { + if (!txHash) { throw new Error('No txHash available'); } - this.props.onBuyProcessing(buyQuote, txnHash); + this.props.onBuyProcessing(buyQuote, txHash); try { - await web3Wrapper.awaitTransactionSuccessAsync(txnHash); + await web3Wrapper.awaitTransactionSuccessAsync(txHash); } catch (e) { if (e instanceof Error && e.message.startsWith('Transaction failed')) { - this.props.onBuyFailure(buyQuote, txnHash); + this.props.onBuyFailure(buyQuote, txHash); return; } throw e; } - this.props.onBuySuccess(buyQuote, txnHash); + this.props.onBuySuccess(buyQuote, txHash); }; } |