Skip to content

fix: spend approval txs labels#41

Merged
blurpesec merged 1 commit intomainfrom
fix/spender-approvals
Apr 21, 2026
Merged

fix: spend approval txs labels#41
blurpesec merged 1 commit intomainfrom
fix/spender-approvals

Conversation

@blurpesec
Copy link
Copy Markdown
Contributor

@blurpesec blurpesec commented Apr 21, 2026

This pull request improves how Ethereum addresses are displayed in transaction approval messages by truncating long addresses for better readability. The changes ensure that both the code and test cases consistently use the shortened address format across transaction categorization and mock data.

Address formatting improvements:

  • Introduced a new utility function truncateAddress in utils.ts to shorten Ethereum addresses, displaying the first 7 and last 5 characters with an ellipsis in between.
  • Updated the transaction metadata generation in txCategorizeV6.ts to use truncateAddress for the spender field in approval transactions, ensuring all generated approval messages use the truncated address.

Test and mock data updates:

  • Modified test cases and mock label data in testCases.mock.ts and txCategorize.test.ts.snap to expect and verify the new truncated address format in approval messages. [1] [2] [3] [4] [5]
  • Added comprehensive unit tests for truncateAddress in utils.test.ts to validate its behavior with various address lengths and edge cases.
  • Updated existing approval-related tests to expect the truncated address format in their assertions.

@blurpesec blurpesec requested a review from a team as a code owner April 21, 2026 18:55
@blurpesec blurpesec merged commit 7943bcb into main Apr 21, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants