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

Implement the account storage API #340

Open
greenhat opened this issue Oct 8, 2024 · 0 comments
Open

Implement the account storage API #340

greenhat opened this issue Oct 8, 2024 · 0 comments
Milestone

Comments

@greenhat
Copy link
Contributor

greenhat commented Oct 8, 2024

As discussed in #333

#[account_storage]
struct MyAccountStorage {

    #[storage_slot(0)]  
    foo: Word,

    #[storage_slot(1)]  
    pub_key: StorageVec,

    #[storage_slot(2)]  
    misc: Word,
}

The attribute macros generate getters and setters (MyAccountStorage::foo().get(), .set(value: Word)) for the fields which call get_item and set_item on the account storage.

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

No branches or pull requests

1 participant