box up some accounts in Optional test
@@ -6,7 +6,7 @@ pub struct Initialize<'info> {
#[account(mut)]
pub payer: Option<Signer<'info>>,
#[account(init, payer = payer, space = DataAccount::LEN, constraint = payer.is_some())]
- pub optional_account: Option<Account<'info, DataAccount>>,
+ pub optional_account: Option<Box<Account<'info, DataAccount>>>,
pub system_program: Option<Program<'info, System>>,
#[account(zero)]
pub required: Account<'info, DataAccount>,
@@ -22,7 +22,7 @@ pub struct Update<'info> {
#[account(mut, seeds=[DataPda::PREFIX.as_ref(), optional_account.as_ref().unwrap().key().as_ref()], bump = pda_bump)]
pub optional_pda: Option<Account<'info, DataPda>>,
#[account(mut, signer, constraint = payer.is_some())]
- pub optional_account: Option<Account<'info, DataAccount>>,
+ pub optional_account: Option<Box<Account<'info, DataAccount>>>,
}
#[derive(Accounts)]
@@ -43,7 +43,7 @@ pub struct Close<'info> {
#[account(mut)]
pub payer: Option<Signer<'info>>,
#[account(mut, close = payer, has_one = data_account)]
- pub optional_pda: Option<Account<'info, DataPda>>,
+ pub optional_pda: Option<Box<Account<'info, DataPda>>>,
#[account(mut, signer, close = payer)]
pub data_account: Option<Account<'info, DataAccount>>,
pub system_program: Option<Program<'info, System>>,
