Skip to content

Commit

Permalink
Show used gas and fee instead of limit
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed Aug 15, 2023
1 parent 21c3374 commit 73ca008
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .changelog/800.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Show used gas and fee instead of limit
2 changes: 1 addition & 1 deletion src/app/components/Transactions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export const Transactions: FC<TransactionsProps> = ({
},
{
align: TableCellAlign.Right,
content: <RoundedBalance value={transaction.fee} ticker={transaction.ticker} />,
content: <RoundedBalance value={transaction.charged_fee} ticker={transaction.ticker} />,
key: 'fee_amount',
},
{
Expand Down
8 changes: 7 additions & 1 deletion src/app/pages/TransactionDetailPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,15 @@ export const TransactionDetailView: FC<{

<dt>{t('common.txnFee')}</dt>
<dd>
{t('common.valueInToken', { ...getPreciseNumberFormat(transaction.fee), ticker: tickerName })}
{t('common.valueInToken', {
...getPreciseNumberFormat(transaction.charged_fee),
ticker: tickerName,
})}
</dd>

<dt>{t('common.gasUsed')}</dt>
<dd>{transaction.gas_used.toLocaleString()}</dd>

<dt>{t('common.gasLimit')}</dt>
<dd>{transaction.gas_limit.toLocaleString()}</dd>

Expand Down
6 changes: 4 additions & 2 deletions src/oasis-nexus/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 73ca008

Please sign in to comment.