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

* useTransactionDisplayData:support safetransferfrom

* useTransactionDisplayData: update test
feature/default_network_editable
Ariella Vu 3 years ago committed by GitHub
parent 3177c6abbb
commit 70bdd9729f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ui/hooks/useTransactionDisplayData.js
  2. 2
      ui/hooks/useTransactionDisplayData.test.js

@ -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…
Cancel
Save