Skip to content

lang: Add state size override#121

Merged
armaniferrante merged 2 commits into
masterfrom
armani/statesize
Mar 24, 2021
Merged

lang: Add state size override#121
armaniferrante merged 2 commits into
masterfrom
armani/statesize

Conversation

@armaniferrante
Copy link
Copy Markdown
Contributor

@armaniferrante armaniferrante commented Mar 24, 2021

Allows one to specify the size of a state account. If none is provided, uses the (current) default, i.e., whatever the size of the returned value of the new ctor (plus 8 bytes for the account discriminator).

Example:

pub const MY_SIZE: u64 = 100;

#[state(MY_SIZE)]
pub struct MyState {
...
}

@armaniferrante armaniferrante merged commit b7cafcd into master Mar 24, 2021
@armaniferrante armaniferrante deleted the armani/statesize branch March 24, 2021 17:35
Otter-0x4ka5h pushed a commit to Otter-0x4ka5h/anchor that referenced this pull request Mar 25, 2026
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.

1 participant