Could someone clarify whether #[account(...)]
used to apply constraints is completely different from #[account]
used to specify the structure representing an account, or if they are related?
#[derive(Accounts)]
pub struct Initialize<'info> {
#[account(init, payer = signer, space = 8 + 8)]
pub new_account: Account<'info, NewAccount>,
#[account(mut)]
pub signer: Signer<'info>,
pub system_program: Program<'info, System>,
}
#[account]
pub struct NewAccount {
data: u64
}
Related pages from anchor-lang below:
https://docs.rs/anchor-lang/latest/anchor_lang/attr.account.html
https://docs.rs/anchor-lang/latest/anchor_lang/derive.Accounts.html