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

account-decoder: don't use strings to convert between Pubkey types #17391

Merged
merged 2 commits into from
May 21, 2021

Conversation

polachok
Copy link
Contributor

Problem

It doesn't make sense to allocate a string for this operation

Summary of Changes

Use arrays instead

@mvines mvines requested a review from CriesofCarrots May 21, 2021 17:09
Copy link
Contributor

@CriesofCarrots CriesofCarrots left a 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()

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();

@polachok
Copy link
Contributor Author

Sure, done

Copy link
Contributor

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

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

Thank you!

@CriesofCarrots CriesofCarrots added v1.6 automerge Merge this Pull Request automatically once CI passes labels May 21, 2021
@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #17391 (dc92f04) into master (6cba534) will increase coverage by 0.0%.
The diff coverage is 92.7%.

@@           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     

@mergify mergify bot merged commit 51178cc into solana-labs:master May 21, 2021
mergify bot pushed a commit that referenced this pull request May 21, 2021
…17391)

* 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)
mergify bot added a commit that referenced this pull request May 22, 2021
…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]>
@polachok polachok deleted the convert-without-strings branch May 24, 2021 07:11
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants