mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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)]);
|
subtitle = t('fromAddress', [shortenAddress(senderAddress)]);
|
||||||
} else if (
|
} else if (
|
||||||
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM ||
|
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER_FROM ||
|
||||||
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER ||
|
type === TRANSACTION_TYPES.TOKEN_METHOD_TRANSFER
|
||||||
type === TRANSACTION_TYPES.TOKEN_METHOD_SAFE_TRANSFER_FROM
|
|
||||||
) {
|
) {
|
||||||
category = TRANSACTION_GROUP_CATEGORIES.SEND;
|
category = TRANSACTION_GROUP_CATEGORIES.SEND;
|
||||||
title = t('sendSpecifiedTokens', [
|
title = t('sendSpecifiedTokens', [
|
||||||
@ -247,6 +246,11 @@ export function useTransactionDisplayData(transactionGroup) {
|
|||||||
]);
|
]);
|
||||||
recipientAddress = getTokenAddressParam(tokenData);
|
recipientAddress = getTokenAddressParam(tokenData);
|
||||||
subtitle = t('toAddress', [shortenAddress(recipientAddress)]);
|
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) {
|
} else if (type === TRANSACTION_TYPES.SIMPLE_SEND) {
|
||||||
category = TRANSACTION_GROUP_CATEGORIES.SEND;
|
category = TRANSACTION_GROUP_CATEGORIES.SEND;
|
||||||
title = t('send');
|
title = t('send');
|
||||||
|
@ -131,7 +131,7 @@ const expectedResults = [
|
|||||||
displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED,
|
displayedStatusKey: TRANSACTION_STATUSES.CONFIRMED,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Send Token',
|
title: 'Safe Transfer From',
|
||||||
category: TRANSACTION_GROUP_CATEGORIES.SEND,
|
category: TRANSACTION_GROUP_CATEGORIES.SEND,
|
||||||
subtitle: 'To: 0xe7d...dd98',
|
subtitle: 'To: 0xe7d...dd98',
|
||||||
subtitleContainsOrigin: true,
|
subtitleContainsOrigin: true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user