-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
account-decoder: don't use strings to convert between Pubkey types #17391
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is better!
There are a couple other places we use this pattern. Would you mind updating those as well?
Pubkey::from_str(&spl_associated_token_account_v1_0::id().to_string()).unwrap() |
solana/transaction-status/src/parse_instruction.rs
Lines 24 to 25 in ff0e623
Pubkey::from_str(&spl_memo::v1::id().to_string()).unwrap(); | |
static ref MEMO_V3_PROGRAM_ID: Pubkey = Pubkey::from_str(&spl_memo::id().to_string()).unwrap(); |
Sure, done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Codecov Report
@@ Coverage Diff @@
## master #17391 +/- ##
========================================
Coverage 82.7% 82.7%
========================================
Files 421 424 +3
Lines 118048 118417 +369
========================================
+ Hits 97664 97989 +325
- Misses 20384 20428 +44 |
…17391) (#17398) * account-decoder: don't use strings to convert between Pubkey types * transaction-status: don't use strings to convert between Pubkey types (cherry picked from commit 51178cc) Co-authored-by: Alexander Polakov <[email protected]>
Problem
It doesn't make sense to allocate a string for this operation
Summary of Changes
Use arrays instead