|
@@ -28,6 +28,7 @@ pub struct TestTokenSeedsInit<'info> {
|
|
|
)]
|
|
|
pub my_pda: Account<'info, TokenAccount>,
|
|
|
#[account(mut)]
|
|
|
+ /// CHECK:
|
|
|
pub authority: AccountInfo<'info>,
|
|
|
pub system_program: Program<'info, System>,
|
|
|
pub rent: Sysvar<'info, Rent>,
|
|
@@ -60,6 +61,7 @@ pub struct TestValidateAssociatedToken<'info> {
|
|
|
)]
|
|
|
pub token: Account<'info, TokenAccount>,
|
|
|
pub mint: Account<'info, Mint>,
|
|
|
+ /// CHECK:
|
|
|
pub wallet: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -70,7 +72,9 @@ pub struct TestInstructionConstraint<'info> {
|
|
|
seeds = [b"my-seed", my_account.key.as_ref()],
|
|
|
bump = nonce,
|
|
|
)]
|
|
|
+ /// CHECK:
|
|
|
pub my_pda: AccountInfo<'info>,
|
|
|
+ /// CHECK:
|
|
|
pub my_account: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -86,6 +90,7 @@ pub struct TestPdaInit<'info> {
|
|
|
pub my_pda: Account<'info, DataU16>,
|
|
|
#[account(mut)]
|
|
|
pub my_payer: Signer<'info>,
|
|
|
+ /// CHECK:
|
|
|
pub foo: AccountInfo<'info>,
|
|
|
pub system_program: Program<'info, System>,
|
|
|
}
|
|
@@ -112,6 +117,7 @@ pub struct TestPdaMutZeroCopy<'info> {
|
|
|
bump = my_pda.load()?.bump,
|
|
|
)]
|
|
|
pub my_pda: Loader<'info, DataZeroCopy>,
|
|
|
+ /// CHECK:
|
|
|
pub my_payer: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -135,29 +141,35 @@ pub struct InitializeSkipRentExempt<'info> {
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct InitializeNoRentExempt<'info> {
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct TestOwner<'info> {
|
|
|
#[account(owner = *misc.key)]
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
+ /// CHECK:
|
|
|
pub misc: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct TestExecutable<'info> {
|
|
|
#[account(executable)]
|
|
|
+ /// CHECK:
|
|
|
pub program: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct TestStateCpi<'info> {
|
|
|
#[account(signer)]
|
|
|
+ /// CHECK:
|
|
|
pub authority: AccountInfo<'info>,
|
|
|
#[account(mut, state = misc2_program)]
|
|
|
pub cpi_state: CpiState<'info, Misc2State>,
|
|
|
#[account(executable)]
|
|
|
+ /// CHECK:
|
|
|
pub misc2_program: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -165,6 +177,7 @@ pub struct TestStateCpi<'info> {
|
|
|
pub struct TestClose<'info> {
|
|
|
#[account(mut, close = sol_dest)]
|
|
|
pub data: Account<'info, Data>,
|
|
|
+ /// CHECK:
|
|
|
sol_dest: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -259,6 +272,7 @@ pub struct TestInitWithEmptySeeds<'info> {
|
|
|
#[derive(Accounts)]
|
|
|
pub struct TestEmptySeedsConstraint<'info> {
|
|
|
#[account(seeds = [], bump)]
|
|
|
+ /// CHECK:
|
|
|
pub pda: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -283,10 +297,12 @@ pub struct TestInitIfNeeded<'info> {
|
|
|
#[derive(Accounts)]
|
|
|
pub struct TestInitIfNeededChecksOwner<'info> {
|
|
|
#[account(init_if_needed, payer = payer, space = 100, owner = *owner.key, seeds = [b"hello"], bump)]
|
|
|
+ /// CHECK:
|
|
|
pub data: UncheckedAccount<'info>,
|
|
|
#[account(mut)]
|
|
|
pub payer: Signer<'info>,
|
|
|
pub system_program: Program<'info, System>,
|
|
|
+ /// CHECK:
|
|
|
pub owner: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -294,6 +310,7 @@ pub struct TestInitIfNeededChecksOwner<'info> {
|
|
|
#[instruction(seed_data: String)]
|
|
|
pub struct TestInitIfNeededChecksSeeds<'info> {
|
|
|
#[account(init_if_needed, payer = payer, space = 100, seeds = [seed_data.as_bytes()], bump)]
|
|
|
+ /// CHECK:
|
|
|
pub data: UncheckedAccount<'info>,
|
|
|
#[account(mut)]
|
|
|
pub payer: Signer<'info>,
|
|
@@ -310,7 +327,9 @@ pub struct TestInitMintIfNeeded<'info> {
|
|
|
pub rent: Sysvar<'info, Rent>,
|
|
|
pub system_program: Program<'info, System>,
|
|
|
pub token_program: Program<'info, Token>,
|
|
|
+ /// CHECK:
|
|
|
pub mint_authority: AccountInfo<'info>,
|
|
|
+ /// CHECK:
|
|
|
pub freeze_authority: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -324,6 +343,7 @@ pub struct TestInitTokenIfNeeded<'info> {
|
|
|
pub rent: Sysvar<'info, Rent>,
|
|
|
pub system_program: Program<'info, System>,
|
|
|
pub token_program: Program<'info, Token>,
|
|
|
+ /// CHECK:
|
|
|
pub authority: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -343,6 +363,7 @@ pub struct TestInitAssociatedTokenIfNeeded<'info> {
|
|
|
pub system_program: Program<'info, System>,
|
|
|
pub token_program: Program<'info, Token>,
|
|
|
pub associated_token_program: Program<'info, AssociatedToken>,
|
|
|
+ /// CHECK:
|
|
|
pub authority: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -360,18 +381,21 @@ pub struct TestConstArraySize<'info> {
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct NoRentExempt<'info> {
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct EnforceRentExempt<'info> {
|
|
|
#[account(rent_exempt = enforce)]
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
#[derive(Accounts)]
|
|
|
pub struct InitDecreaseLamports<'info> {
|
|
|
#[account(init, payer = user, space = 1000)]
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
#[account(mut)]
|
|
|
pub user: Signer<'info>,
|
|
@@ -381,6 +405,7 @@ pub struct InitDecreaseLamports<'info> {
|
|
|
#[derive(Accounts)]
|
|
|
pub struct InitIfNeededChecksRentExemption<'info> {
|
|
|
#[account(init_if_needed, payer = user, space = 1000)]
|
|
|
+ /// CHECK:
|
|
|
pub data: AccountInfo<'info>,
|
|
|
#[account(mut)]
|
|
|
pub user: Signer<'info>,
|
|
@@ -393,9 +418,11 @@ pub struct TestProgramIdConstraint<'info> {
|
|
|
// not a real associated token account
|
|
|
// just deriving like this for testing purposes
|
|
|
#[account(seeds = [b"seed"], bump = bump, seeds::program = anchor_spl::associated_token::ID)]
|
|
|
+ /// CHECK:
|
|
|
first: AccountInfo<'info>,
|
|
|
|
|
|
#[account(seeds = [b"seed"], bump = second_bump, seeds::program = crate::ID)]
|
|
|
+ /// CHECK:
|
|
|
second: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
@@ -404,8 +431,30 @@ pub struct TestProgramIdConstraintUsingFindPda<'info> {
|
|
|
// not a real associated token account
|
|
|
// just deriving like this for testing purposes
|
|
|
#[account(seeds = [b"seed"], bump, seeds::program = anchor_spl::associated_token::ID)]
|
|
|
+ /// CHECK:
|
|
|
first: AccountInfo<'info>,
|
|
|
|
|
|
#[account(seeds = [b"seed"], bump, seeds::program = crate::ID)]
|
|
|
+ /// CHECK:
|
|
|
second: AccountInfo<'info>,
|
|
|
}
|
|
|
+
|
|
|
+#[derive(Accounts)]
|
|
|
+pub struct TestUnsafeFieldSafetyErrors<'info> {
|
|
|
+ #[doc = "test"]
|
|
|
+ /// CHECK:
|
|
|
+ pub data: UncheckedAccount<'info>,
|
|
|
+ #[account(mut)]
|
|
|
+ /// CHECK:
|
|
|
+ pub data_two: UncheckedAccount<'info>,
|
|
|
+ #[account(
|
|
|
+ seeds = [b"my-seed", signer.key.as_ref()],
|
|
|
+ bump
|
|
|
+ )]
|
|
|
+ /// CHECK:
|
|
|
+ pub data_three: UncheckedAccount<'info>,
|
|
|
+ /// CHECK:
|
|
|
+ pub data_four: UncheckedAccount<'info>,
|
|
|
+ pub signer: Signer<'info>,
|
|
|
+ pub system_program: Program<'info, System>,
|
|
|
+}
|