Skip to content

Commit

Permalink
fix: show the freeze address as the target for asset freeze transacti…
Browse files Browse the repository at this point in the history
…ons (#39)
  • Loading branch information
PatrickDinh authored May 1, 2024
1 parent a3b3f46 commit a6b4e94
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/features/transactions/components/transactions-graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/features/transactions/components/transactions-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export const transactionsTableColumns: ColumnDef<FlattenedTransaction>[] = [
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)
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/features/transactions/pages/transaction-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
},
],
})
Expand Down

0 comments on commit a6b4e94

Please sign in to comment.