-
Notifications
You must be signed in to change notification settings - Fork 839
Remove usages of WritableAccount::create
#9279
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9279 +/- ##
=========================================
- Coverage 82.6% 82.6% -0.1%
=========================================
Files 890 890
Lines 320722 320797 +75
=========================================
- Hits 265085 265064 -21
- Misses 55637 55733 +96 🚀 New features to boost your workflow:
|
buffalojoec
left a comment
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.
Lgtm!
| let decoded_account = encoded_account.to_account_shared_data().unwrap(); | ||
| assert_eq!(decoded_account.data(), &vec![0; 1024]); | ||
| let decoded_account = encoded_account.decode::<AccountSharedData>().unwrap(); | ||
| let decoded_account = encoded_account.to_account().unwrap(); |
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.
It doesn't really matter, but these are flipped.
brooksprumo
left a comment
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.
![]()
|
Reference back to related first PR: #8668 |
Remove usages of fn create
Problem
We want to remove
fn createfromtrait WritableAccount, since program-runtime has adopted an account interface that contains references and cannot be created with owned types like those offn create's signature.Following the discussion in anza-xyz/solana-sdk#456 (review), we will replace
WritableAccount::createbyAccountSharedData::create_from_existing_shared_dataforAccountSharedData, andAccountinstances will be initialized directly since all its members are public.Summary of Changes
WritableAccount::createbyAccountSharedData::create_from_existing_shared_dataforAccountSharedData.Accountdirectly.