mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Use initial transaction for settings swap transaction title params (#9543)
* Use initial transaction for settings swap transaction title params, and remove addition of swap properties to cancel transcations * Update unit test data * Use token symbol properties from initial transaction for filitering in transaction list
This commit is contained in:
parent
d67a446131
commit
6409caa081
@ -366,11 +366,6 @@ export default class TransactionController extends EventEmitter {
|
||||
type: TRANSACTION_TYPE_CANCEL,
|
||||
})
|
||||
|
||||
if (originalTxMeta.transactionCategory === SWAP) {
|
||||
newTxMeta.sourceTokenSymbol = originalTxMeta.sourceTokenSymbol
|
||||
newTxMeta.destinationTokenSymbol = originalTxMeta.destinationTokenSymbol
|
||||
}
|
||||
|
||||
this.addTx(newTxMeta)
|
||||
await this.approveTransaction(newTxMeta.id)
|
||||
return newTxMeta
|
||||
|
@ -512,6 +512,8 @@
|
||||
"value": "0xde0b6b3a7640000"
|
||||
},
|
||||
"hash": "0xbcb195f393f4468945b4045cd41bcdbc2f19ad75ae92a32cf153a3004e42009a",
|
||||
"destinationTokenSymbol": "ABC",
|
||||
"sourceTokenSymbol": "ETH",
|
||||
"transactionCategory": "swap"
|
||||
},
|
||||
"primaryTransaction": {
|
||||
|
@ -29,8 +29,6 @@ const getTransactionGroupRecipientAddressFilter = (recipientAddress) => {
|
||||
const tokenTransactionFilter = ({
|
||||
initialTransaction: {
|
||||
transactionCategory,
|
||||
},
|
||||
primaryTransaction: {
|
||||
destinationTokenSymbol,
|
||||
sourceTokenSymbol,
|
||||
},
|
||||
|
@ -133,14 +133,14 @@ export function useTransactionDisplayData (transactionGroup) {
|
||||
} else if (transactionCategory === SWAP) {
|
||||
category = TRANSACTION_CATEGORY_SWAP
|
||||
title = t('swapTokenToToken', [
|
||||
primaryTransaction.sourceTokenSymbol,
|
||||
primaryTransaction.destinationTokenSymbol,
|
||||
initialTransaction.sourceTokenSymbol,
|
||||
initialTransaction.destinationTokenSymbol,
|
||||
])
|
||||
subtitle = origin
|
||||
subtitleContainsOrigin = true
|
||||
primarySuffix = isViewingReceivedTokenFromSwap
|
||||
? currentAsset.symbol
|
||||
: primaryTransaction.sourceTokenSymbol
|
||||
: initialTransaction.sourceTokenSymbol
|
||||
primaryDisplayValue = swapTokenValue
|
||||
secondaryDisplayValue = swapTokenFiatAmount
|
||||
prefix = isViewingReceivedTokenFromSwap ? '+' : '-'
|
||||
|
Loading…
Reference in New Issue
Block a user