1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

fix stuck speedup problem (#12122)

This commit is contained in:
Brad Decker 2021-09-15 16:42:06 -05:00 committed by GitHub
parent 9d968bae1e
commit 2100fb0ce1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 34 deletions

View File

@ -100,40 +100,32 @@ export default class TransactionBreakdown extends PureComponent {
/> />
</TransactionBreakdownRow> </TransactionBreakdownRow>
)} )}
{isEIP1559Transaction && ( {isEIP1559Transaction && typeof baseFee !== 'undefined' ? (
<TransactionBreakdownRow title={t('transactionHistoryBaseFee')}> <TransactionBreakdownRow title={t('transactionHistoryBaseFee')}>
{typeof baseFee === 'undefined' ? ( <CurrencyDisplay
'?' className="transaction-breakdown__value"
) : ( data-testid="transaction-breakdown__base-fee"
<CurrencyDisplay currency={nativeCurrency}
className="transaction-breakdown__value" denomination={GWEI}
data-testid="transaction-breakdown__base-fee" value={baseFee}
currency={nativeCurrency} numberOfDecimals={10}
denomination={GWEI} hideLabel
value={baseFee} />
numberOfDecimals={10}
hideLabel
/>
)}
</TransactionBreakdownRow> </TransactionBreakdownRow>
)} ) : null}
{isEIP1559Transaction && ( {isEIP1559Transaction && typeof priorityFee !== 'undefined' ? (
<TransactionBreakdownRow title={t('transactionHistoryPriorityFee')}> <TransactionBreakdownRow title={t('transactionHistoryPriorityFee')}>
{typeof priorityFee === 'undefined' ? ( <CurrencyDisplay
'?' className="transaction-breakdown__value"
) : ( data-testid="transaction-breakdown__priority-fee"
<CurrencyDisplay currency={nativeCurrency}
className="transaction-breakdown__value" denomination={GWEI}
data-testid="transaction-breakdown__priority-fee" value={priorityFee}
currency={nativeCurrency} numberOfDecimals={10}
denomination={GWEI} hideLabel
value={priorityFee} />
numberOfDecimals={10}
hideLabel
/>
)}
</TransactionBreakdownRow> </TransactionBreakdownRow>
)} ) : null}
{!isEIP1559Transaction && ( {!isEIP1559Transaction && (
<TransactionBreakdownRow title={t('advancedGasPriceTitle')}> <TransactionBreakdownRow title={t('advancedGasPriceTitle')}>
{typeof gasPrice === 'undefined' ? ( {typeof gasPrice === 'undefined' ? (

View File

@ -281,11 +281,17 @@ export const nonceSortedTransactionsSelector = createSelector(
nonceProps.initialTransaction = transaction; nonceProps.initialTransaction = transaction;
} }
if (type === TRANSACTION_TYPES.RETRY) { if (
type === TRANSACTION_TYPES.RETRY &&
status in PRIORITY_STATUS_HASH
) {
nonceProps.hasRetried = true; nonceProps.hasRetried = true;
} }
if (type === TRANSACTION_TYPES.CANCEL) { if (
type === TRANSACTION_TYPES.CANCEL &&
status in PRIORITY_STATUS_HASH
) {
nonceProps.hasCancelled = true; nonceProps.hasCancelled = true;
} }
} else { } else {
@ -294,8 +300,12 @@ export const nonceSortedTransactionsSelector = createSelector(
transactions: [transaction], transactions: [transaction],
initialTransaction: transaction, initialTransaction: transaction,
primaryTransaction: transaction, primaryTransaction: transaction,
hasRetried: transaction.type === TRANSACTION_TYPES.RETRY, hasRetried:
hasCancelled: transaction.type === TRANSACTION_TYPES.CANCEL, transaction.type === TRANSACTION_TYPES.RETRY &&
transaction.status in PRIORITY_STATUS_HASH,
hasCancelled:
transaction.type === TRANSACTION_TYPES.CANCEL &&
transaction.status in PRIORITY_STATUS_HASH,
}; };
insertOrderedNonce(orderedNonces, nonce); insertOrderedNonce(orderedNonces, nonce);