From c821a8354c8eba05885ca219f39aedafbd4f8052 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Tue, 16 Oct 2018 06:00:47 +0800 Subject: Add txReceipt data to transaction details (#5513) --- .../transaction-breakdown.component.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'ui/app/components/transaction-breakdown/transaction-breakdown.component.js') diff --git a/ui/app/components/transaction-breakdown/transaction-breakdown.component.js b/ui/app/components/transaction-breakdown/transaction-breakdown.component.js index bb6075e9f..5a2b4a481 100644 --- a/ui/app/components/transaction-breakdown/transaction-breakdown.component.js +++ b/ui/app/components/transaction-breakdown/transaction-breakdown.component.js @@ -26,8 +26,11 @@ export default class TransactionBreakdown extends PureComponent { render () { const { t } = this.context const { transaction, className } = this.props - const { txParams: { gas, gasPrice, value } = {} } = transaction - const hexGasTotal = getHexGasTotal({ gasLimit: gas, gasPrice }) + const { txParams: { gas, gasPrice, value } = {}, txReceipt: { gasUsed } = {} } = transaction + + const gasLimit = typeof gasUsed === 'string' ? gasUsed : gas + + const hexGasTotal = getHexGasTotal({ gasLimit, gasPrice }) const totalInHex = sumHexes(hexGasTotal, value) return ( @@ -52,6 +55,19 @@ export default class TransactionBreakdown extends PureComponent { value={gas} /> + { + typeof gasUsed === 'string' && ( + + + + ) + }