From 9e227682da6013f57bd0824e719d1d6829e74871 Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Tue, 15 Aug 2023 16:50:26 +0200 Subject: [PATCH] Show used gas and fee instead of limit --- .changelog/800.bugfix.md | 1 + src/app/components/Transactions/index.tsx | 2 +- src/app/pages/TransactionDetailPage/index.tsx | 8 +++++++- src/oasis-nexus/api.ts | 6 ++++-- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .changelog/800.bugfix.md diff --git a/.changelog/800.bugfix.md b/.changelog/800.bugfix.md new file mode 100644 index 0000000000..ab77bca27f --- /dev/null +++ b/.changelog/800.bugfix.md @@ -0,0 +1 @@ +Show used gas and fee instead of limit diff --git a/src/app/components/Transactions/index.tsx b/src/app/components/Transactions/index.tsx index 0e9239a37e..ab755cb9fc 100644 --- a/src/app/components/Transactions/index.tsx +++ b/src/app/components/Transactions/index.tsx @@ -188,7 +188,7 @@ export const Transactions: FC = ({ }, { align: TableCellAlign.Right, - content: , + content: , key: 'fee_amount', }, { diff --git a/src/app/pages/TransactionDetailPage/index.tsx b/src/app/pages/TransactionDetailPage/index.tsx index a139f74acb..68c90ad91e 100644 --- a/src/app/pages/TransactionDetailPage/index.tsx +++ b/src/app/pages/TransactionDetailPage/index.tsx @@ -323,9 +323,15 @@ export const TransactionDetailView: FC<{
{t('common.txnFee')}
- {t('common.valueInToken', { ...getPreciseNumberFormat(transaction.fee), ticker: tickerName })} + {t('common.valueInToken', { + ...getPreciseNumberFormat(transaction.charged_fee), + ticker: tickerName, + })}
+
{t('common.gasUsed')}
+
{transaction.gas_used.toLocaleString()}
+
{t('common.gasLimit')}
{transaction.gas_limit.toLocaleString()}
diff --git a/src/oasis-nexus/api.ts b/src/oasis-nexus/api.ts index d43f444bb6..a704b01c1a 100644 --- a/src/oasis-nexus/api.ts +++ b/src/oasis-nexus/api.ts @@ -151,7 +151,8 @@ export const useGetRuntimeTransactions: typeof generated.useGetRuntimeTransactio return { ...tx, eth_hash: tx.eth_hash ? `0x${tx.eth_hash}` : undefined, - fee: tx.fee ? fromBaseUnits(tx.fee, paraTimesConfig[runtime].decimals) : undefined, + fee: fromBaseUnits(tx.fee, paraTimesConfig[runtime].decimals), + charged_fee: fromBaseUnits(tx.charged_fee, paraTimesConfig[runtime].decimals), amount: tx.amount ? fromBaseUnits(tx.amount, paraTimesConfig[runtime].decimals) : undefined, layer: runtime, network, @@ -222,7 +223,8 @@ export const useGetRuntimeTransactionsTxHash: typeof generated.useGetRuntimeTran return { ...tx, eth_hash: tx.eth_hash ? `0x${tx.eth_hash}` : undefined, - fee: tx.fee ? fromBaseUnits(tx.fee, paraTimesConfig[runtime].decimals) : undefined, + fee: fromBaseUnits(tx.fee, paraTimesConfig[runtime].decimals), + charged_fee: fromBaseUnits(tx.charged_fee, paraTimesConfig[runtime].decimals), amount: tx.amount ? fromBaseUnits(tx.amount, paraTimesConfig[runtime].decimals) : undefined, layer: runtime, network,