Skip to content

Why doesn't the UserState account need an additional space ANCHOR_DESCRIMINATOR_SIZE in example close-account #353

Open
@SpriteOvO

Description

@SpriteOvO

#[account(
init,
payer = user,
space = UserState::INIT_SPACE,
seeds = [
b"USER",
user.key().as_ref(),
],
bump
)]
pub user_account: Account<'info, UserState>,

Why doesn't this account space need an additional ANCHOR_DESCRIMINATOR_SIZE (8) but the below does?

#[account(
init,
payer = payer,
space = ANCHOR_DESCRIMINATOR_SIZE + AddressInfo::INIT_SPACE,
)]
address_info: Account<'info, AddressInfo>,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions