Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): add edge case for SOL txn from and to my wallet #4123

Merged
merged 6 commits into from
Jan 8, 2025

Conversation

loki344
Copy link
Collaborator

@loki344 loki344 commented Jan 8, 2025

Motivation

Add the edge case where a user sends an amount from his wallet, to his wallet. Due to the hard coded values of the from and to in the mapper, this is handled wrongly. In these cases, the SOL transaction only includes 3 Accountkeys: My wallet, the SOL System Program, and the SOL Compute Budget program. This case needs special handling which is introduced by a ternary in the mapper.

Changes

Add SystemAccountKeys from SOL to filter them out. Add edge case in mapping functionality to have correct recipient.

Tests

Unit test added for this case

@loki344 loki344 marked this pull request as ready for review January 8, 2025 10:31
@loki344 loki344 requested a review from a team as a code owner January 8, 2025 10:31
github-actions bot and others added 3 commits January 8, 2025 10:33
…om-and-to-my-wallet' into feat(frontend)/handle-sol-txn-from-and-to-my-wallet

# Conflicts:
#	src/frontend/src/sol/utils/sol-transactions.utils.ts
Copy link
Collaborator

@AntonioVentilii AntonioVentilii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM tks

@loki344 loki344 enabled auto-merge (squash) January 8, 2025 11:39
@loki344 loki344 merged commit e2c7a73 into main Jan 8, 2025
21 checks passed
@loki344 loki344 deleted the feat(frontend)/handle-sol-txn-from-and-to-my-wallet branch January 8, 2025 11:42
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