From a6b4e9481e4edfb854d706afd2e71c5198b0d099 Mon Sep 17 00:00:00 2001 From: Hoang Dinh Date: Wed, 1 May 2024 13:12:28 +1000 Subject: [PATCH] fix: show the freeze address as the target for asset freeze transactions (#39) --- src/features/transactions/components/transactions-graph.tsx | 6 +++--- src/features/transactions/components/transactions-table.tsx | 3 ++- src/features/transactions/pages/transaction-page.test.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/features/transactions/components/transactions-graph.tsx b/src/features/transactions/components/transactions-graph.tsx index b105b49fd..a099f1107 100644 --- a/src/features/transactions/components/transactions-graph.tsx +++ b/src/features/transactions/components/transactions-graph.tsx @@ -588,7 +588,7 @@ function getTransactionRepresentation( } if (transaction.type === TransactionType.AssetFreeze) { - return collaborators.findIndex((a) => transaction.assetId.toString() === a.id) + return collaborators.findIndex((a) => transaction.address.toString() === a.id) } throw new Error('Not supported transaction type') @@ -729,8 +729,8 @@ const getTransactionCollaborators = (transaction: Transaction | InnerTransaction } if (transaction.type === TransactionType.AssetFreeze) { collaborators.push({ - type: 'Asset', - id: transaction.assetId.toString(), + type: 'Account', + id: transaction.address.toString(), }) } return collaborators diff --git a/src/features/transactions/components/transactions-table.tsx b/src/features/transactions/components/transactions-table.tsx index 2aaccf9e1..0b020d2c4 100644 --- a/src/features/transactions/components/transactions-table.tsx +++ b/src/features/transactions/components/transactions-table.tsx @@ -56,7 +56,8 @@ export const transactionsTableColumns: ColumnDef[] = [ if (transaction.type === TransactionType.Payment || transaction.type === TransactionType.AssetTransfer) return ellipseAddress(transaction.receiver) if (transaction.type === TransactionType.ApplicationCall) return transaction.applicationId - if (transaction.type === TransactionType.AssetConfig || transaction.type === TransactionType.AssetFreeze) return transaction.assetId + if (transaction.type === TransactionType.AssetConfig) return transaction.assetId + if (transaction.type === TransactionType.AssetFreeze) return ellipseAddress(transaction.address) }, }, { diff --git a/src/features/transactions/pages/transaction-page.test.tsx b/src/features/transactions/pages/transaction-page.test.tsx index 361110a97..deeacacbc 100644 --- a/src/features/transactions/pages/transaction-page.test.tsx +++ b/src/features/transactions/pages/transaction-page.test.tsx @@ -1026,7 +1026,7 @@ describe('transaction-page', () => { container: tableViewTab, rows: [ { - cells: ['2XFGVOH...', 'E4A6...VZHY', '1707148495', 'Asset Freeze'], + cells: ['2XFGVOH...', 'E4A6...VZHY', 'ZJU3...CBQQ', 'Asset Freeze'], }, ], })