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

Enables the "Safe Transaction From" copy for safeTransferFrom transactions (#14769)

* useTransactionDisplayData:support safetransferfrom

* useTransactionDisplayData: update test
This commit is contained in:
Ariella Vu 2022-05-25 10:13:15 -05:00 committed by GitHub
parent 3177c6abbb
commit 70bdd9729f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -238,8 +238,7 @@ export function useTransactionDisplayData(transactionGroup) {
subtitle = t('fromAddress', [shortenAddress(senderAddress)]);
} else if (
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM ||
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER ||
type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER
) {
category = TRANSACTION_GROUP_CATEGORIES.SEND;
title = t('sendSpecifiedTokens', [
@ -247,6 +246,11 @@ export function useTransactionDisplayData(transactionGroup) {
]);
recipientAddress = getTokenAddressParam(tokenData);
subtitle = t('toAddress', [shortenAddress(recipientAddress)]);
} else if (type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM) {
category = TRANSACTION_GROUP_CATEGORIES.SEND;
title = t('safeTransferFrom');
recipientAddress = getTokenAddressParam(tokenData);
subtitle = t('toAddress', [shortenAddress(recipientAddress)]);
} else if (type === TRANSACTION_TYPES.SIMPLE_SEND) {
category = TRANSACTION_GROUP_CATEGORIES.SEND;
title = t('send');

View File

@ -131,7 +131,7 @@ const expectedResults = [
displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED,
},
{
title: 'Send Token',
title: 'Safe Transfer From',
category: TRANSACTION_GROUP_CATEGORIES.SEND,
subtitle: 'To: 0xe7d...dd98',
subtitleContainsOrigin: true,