Skip to content

Conversation

@LucasSte
Copy link
Contributor

@LucasSte LucasSte commented Nov 24, 2025

Problem

We want to remove fn create from WritableAccount, because the new account format for SVM has only references and does not allow one to create it from owned values, like the function in the trait.

I tracked all monorepo usages, and found that create is only used for AccountSharedData. There is a single usage for struct Account, but all its fields are public, so we can create it directly. See LucasSte/agave@224a93e

Solution

Create fn compose in impl AccountSharedData to replace fn create.

@LucasSte LucasSte marked this pull request as ready for review November 24, 2025 22:00
Copy link
Contributor

@brooksprumo brooksprumo left a comment

Choose a reason for hiding this comment

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

I don't think we need a new constructor.

We should be able to use AccountSharedData::create_from_existing_shared_data() in all the places.

Or for the tests, they could create an Account first, then convert to AccountSharedData if needed, via Into/From.

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