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:
parent
3177c6abbb
commit
70bdd9729f
@ -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');
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user