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

[MMI] Don't group transactions by nonce if they are custodial Tx (#18982)

* adds mmi fence

* adds comment and casts variable to bool

* prettier
This commit is contained in:
António Regadas 2023-05-03 16:00:38 +01:00 committed by GitHub
parent bf0a70dbba
commit c4e1edef19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -251,7 +251,18 @@ export const nonceSortedTransactionsSelector = createSelector(
txReceipt, txReceipt,
} = transaction; } = transaction;
if (typeof nonce === 'undefined' || type === TransactionType.incoming) { // Don't group transactions by nonce if:
// 1. Tx nonce is undefined
// 2. Tx is incoming (deposit)
// 3. Tx is custodial (mmi specific)
let shouldNotBeGrouped =
typeof nonce === 'undefined' || type === TransactionType.incoming;
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
shouldNotBeGrouped = shouldNotBeGrouped || Boolean(transaction.custodyId);
///: END:ONLY_INCLUDE_IN
if (shouldNotBeGrouped) {
const transactionGroup = { const transactionGroup = {
transactions: [transaction], transactions: [transaction],
initialTransaction: transaction, initialTransaction: transaction,