Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Avoid unwrap in get_token_account for solana#1138

Merged
0xh3rman merged 2 commits into
mainfrom
solana-cleanup
May 18, 2026
Merged

Avoid unwrap in get_token_account for solana#1138
0xh3rman merged 2 commits into
mainfrom
solana-cleanup

Conversation

@0xh3rman
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves error handling across the Solana-related crates by replacing several unwrap() calls with proper Result propagation, specifically in get_token_account and seed_from_blockhash. It also introduces new test mocks and updates the swapper crate to handle these new error types. Feedback suggests optimizing the repeated parsing of the associated token program ID by using a pre-parsed constant and refining the error mapping in the swapper crate to provide more accurate error messages beyond a generic 'INVALID_ADDRESS' prefix.

Comment thread crates/gem_solana/src/token_account.rs Outdated
Comment thread crates/swapper/src/error.rs
@0xh3rman 0xh3rman merged commit c878c44 into main May 18, 2026
4 checks passed
@0xh3rman 0xh3rman deleted the solana-cleanup branch May 18, 2026 11:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant