diff --git a/bench/BINARY_SIZE.md b/bench/BINARY_SIZE.md index 56c4a70907..8e95217171 100644 --- a/bench/BINARY_SIZE.md +++ b/bench/BINARY_SIZE.md @@ -16,9 +16,9 @@ The programs and their tests are located in [/tests/bench](https://github.com/ot Solana version: 2.3.0 -| Program | Binary Size | - | -| ------- | ----------- | --- | -| bench | 932,992 | - | +| Program | Binary Size | - | +| ------- | ----------- | ---------------------- | +| bench | 917,416 | 🟢 **-15,576 (1.67%)** | ### Notable changes diff --git a/bench/COMPUTE_UNITS.md b/bench/COMPUTE_UNITS.md index 28a22ee360..6be90fe13f 100644 --- a/bench/COMPUTE_UNITS.md +++ b/bench/COMPUTE_UNITS.md @@ -16,95 +16,95 @@ The programs and their tests are located in [/tests/bench](https://github.com/ot Solana version: 2.3.0 -| Instruction | Compute Units | - | -| --------------------------- | ------------- | ------------------ | -| accountInfo1 | 702 | - | -| accountInfo2 | 1,115 | - | -| accountInfo4 | 1,921 | - | -| accountInfo8 | 3,480 | - | -| accountEmptyInit1 | 4,716 | - | -| accountEmpty1 | 738 | - | -| accountEmptyInit2 | 8,379 | - | -| accountEmpty2 | 1,138 | - | -| accountEmptyInit4 | 15,699 | - | -| accountEmpty4 | 1,923 | - | -| accountEmptyInit8 | 30,347 | - | -| accountEmpty8 | 3,500 | - | -| accountSizedInit1 | 4,810 | - | -| accountSized1 | 786 | - | -| accountSizedInit2 | 8,546 | - | -| accountSized2 | 1,198 | - | -| accountSizedInit4 | 16,020 | - | -| accountSized4 | 2,031 | - | -| accountSizedInit8 | 30,931 | - | -| accountSized8 | 3,694 | - | -| accountUnsizedInit1 | 4,913 | - | -| accountUnsized1 | 814 | - | -| accountUnsizedInit2 | 8,733 | - | -| accountUnsized2 | 1,240 | - | -| accountUnsizedInit4 | 16,343 | - | -| accountUnsized4 | 2,093 | - | -| accountUnsizedInit8 | 31,553 | - | -| accountUnsized8 | 3,797 | - | -| boxedAccountEmptyInit1 | 4,810 | - | -| boxedAccountEmpty1 | 831 | - | -| boxedAccountEmptyInit2 | 8,496 | - | -| boxedAccountEmpty2 | 1,253 | - | -| boxedAccountEmptyInit4 | 15,859 | - | -| boxedAccountEmpty4 | 2,077 | - | -| boxedAccountEmptyInit8 | 30,594 | - | -| boxedAccountEmpty8 | 3,797 | - | -| boxedAccountSizedInit1 | 4,898 | - | -| boxedAccountSized1 | 877 | - | -| boxedAccountSizedInit2 | 8,648 | - | -| boxedAccountSized2 | 1,318 | - | -| boxedAccountSizedInit4 | 16,139 | - | -| boxedAccountSized4 | 2,185 | - | -| boxedAccountSizedInit8 | 31,130 | - | -| boxedAccountSized8 | 3,984 | - | -| boxedAccountUnsizedInit1 | 4,990 | - | -| boxedAccountUnsized1 | 907 | - | -| boxedAccountUnsizedInit2 | 8,808 | - | -| boxedAccountUnsized2 | 1,352 | - | -| boxedAccountUnsizedInit4 | 16,435 | - | -| boxedAccountUnsized4 | 2,234 | - | -| boxedAccountUnsizedInit8 | 31,698 | - | -| boxedAccountUnsized8 | 4,063 | - | -| boxedInterfaceAccountMint1 | 1,090 | - | -| boxedInterfaceAccountMint2 | 1,486 | - | -| boxedInterfaceAccountMint4 | 2,268 | - | -| boxedInterfaceAccountMint8 | 3,907 | - | -| boxedInterfaceAccountToken1 | 1,217 | - | -| boxedInterfaceAccountToken2 | 1,728 | - | -| boxedInterfaceAccountToken4 | 2,740 | - | -| boxedInterfaceAccountToken8 | 4,839 | - | -| interfaceAccountMint1 | 1,105 | - | -| interfaceAccountMint2 | 1,490 | - | -| interfaceAccountMint4 | 2,268 | - | -| interfaceAccountMint8 | 3,835 | - | -| interfaceAccountToken1 | 1,237 | - | -| interfaceAccountToken2 | 1,749 | - | -| interfaceAccountToken4 | 2,775 | - | -| interface1 | 883 | - | -| interface2 | 1,029 | - | -| interface4 | 1,308 | - | -| interface8 | 1,873 | - | -| program1 | 899 | - | -| program2 | 1,035 | 🟢 **-14 (1.33%)** | -| program4 | 1,308 | 🟢 **-28 (2.10%)** | -| program8 | 1,861 | 🟢 **-56 (2.92%)** | -| signer1 | 888 | - | -| signer2 | 1,237 | - | -| signer4 | 1,920 | - | -| signer8 | 3,293 | - | -| systemAccount1 | 910 | - | -| systemAccount2 | 1,269 | - | -| systemAccount4 | 1,972 | - | -| systemAccount8 | 3,385 | - | -| uncheckedAccount1 | 896 | - | -| uncheckedAccount2 | 1,227 | - | -| uncheckedAccount4 | 1,875 | - | -| uncheckedAccount8 | 3,171 | - | +| Instruction | Compute Units | - | +| --------------------------- | ------------- | -------------------- | +| accountInfo1 | 647 | 🟢 **-55 (7.83%)** | +| accountInfo2 | 978 | 🟢 **-137 (12.29%)** | +| accountInfo4 | 1,626 | 🟢 **-295 (15.36%)** | +| accountInfo8 | 2,922 | 🟢 **-558 (16.03%)** | +| accountEmptyInit1 | 4,716 | - | +| accountEmpty1 | 738 | - | +| accountEmptyInit2 | 8,379 | - | +| accountEmpty2 | 1,138 | - | +| accountEmptyInit4 | 15,699 | - | +| accountEmpty4 | 1,923 | - | +| accountEmptyInit8 | 30,347 | - | +| accountEmpty8 | 3,500 | - | +| accountSizedInit1 | 4,810 | - | +| accountSized1 | 786 | - | +| accountSizedInit2 | 8,546 | - | +| accountSized2 | 1,198 | - | +| accountSizedInit4 | 16,020 | - | +| accountSized4 | 2,031 | - | +| accountSizedInit8 | 30,931 | - | +| accountSized8 | 3,694 | - | +| accountUnsizedInit1 | 4,913 | - | +| accountUnsized1 | 814 | - | +| accountUnsizedInit2 | 8,733 | - | +| accountUnsized2 | 1,240 | - | +| accountUnsizedInit4 | 16,343 | - | +| accountUnsized4 | 2,093 | - | +| accountUnsizedInit8 | 31,553 | - | +| accountUnsized8 | 3,797 | - | +| boxedAccountEmptyInit1 | 4,810 | - | +| boxedAccountEmpty1 | 831 | - | +| boxedAccountEmptyInit2 | 8,496 | - | +| boxedAccountEmpty2 | 1,253 | - | +| boxedAccountEmptyInit4 | 15,859 | - | +| boxedAccountEmpty4 | 2,077 | - | +| boxedAccountEmptyInit8 | 30,594 | - | +| boxedAccountEmpty8 | 3,797 | - | +| boxedAccountSizedInit1 | 4,898 | - | +| boxedAccountSized1 | 877 | - | +| boxedAccountSizedInit2 | 8,648 | - | +| boxedAccountSized2 | 1,318 | - | +| boxedAccountSizedInit4 | 16,139 | - | +| boxedAccountSized4 | 2,185 | - | +| boxedAccountSizedInit8 | 31,130 | - | +| boxedAccountSized8 | 3,984 | - | +| boxedAccountUnsizedInit1 | 4,990 | - | +| boxedAccountUnsized1 | 907 | - | +| boxedAccountUnsizedInit2 | 8,808 | - | +| boxedAccountUnsized2 | 1,352 | - | +| boxedAccountUnsizedInit4 | 16,435 | - | +| boxedAccountUnsized4 | 2,234 | - | +| boxedAccountUnsizedInit8 | 31,698 | - | +| boxedAccountUnsized8 | 4,063 | - | +| boxedInterfaceAccountMint1 | 1,090 | - | +| boxedInterfaceAccountMint2 | 1,486 | - | +| boxedInterfaceAccountMint4 | 2,268 | - | +| boxedInterfaceAccountMint8 | 3,907 | - | +| boxedInterfaceAccountToken1 | 1,217 | - | +| boxedInterfaceAccountToken2 | 1,728 | - | +| boxedInterfaceAccountToken4 | 2,740 | - | +| boxedInterfaceAccountToken8 | 4,839 | - | +| interfaceAccountMint1 | 1,105 | - | +| interfaceAccountMint2 | 1,490 | - | +| interfaceAccountMint4 | 2,268 | - | +| interfaceAccountMint8 | 3,835 | - | +| interfaceAccountToken1 | 1,237 | - | +| interfaceAccountToken2 | 1,749 | - | +| interfaceAccountToken4 | 2,775 | - | +| interface1 | 883 | - | +| interface2 | 1,029 | - | +| interface4 | 1,308 | - | +| interface8 | 1,873 | - | +| program1 | 899 | - | +| program2 | 1,035 | 🟢 **-14 (1.33%)** | +| program4 | 1,308 | 🟢 **-28 (2.10%)** | +| program8 | 1,861 | 🟢 **-56 (2.92%)** | +| signer1 | 888 | - | +| signer2 | 1,237 | - | +| signer4 | 1,920 | - | +| signer8 | 3,293 | - | +| systemAccount1 | 910 | - | +| systemAccount2 | 1,269 | - | +| systemAccount4 | 1,972 | - | +| systemAccount8 | 3,385 | - | +| uncheckedAccount1 | 896 | - | +| uncheckedAccount2 | 1,227 | - | +| uncheckedAccount4 | 1,875 | - | +| uncheckedAccount8 | 3,171 | - | ### Notable changes diff --git a/bench/STACK_MEMORY.md b/bench/STACK_MEMORY.md index 05c61c4d20..e033945693 100644 --- a/bench/STACK_MEMORY.md +++ b/bench/STACK_MEMORY.md @@ -16,95 +16,95 @@ The programs and their tests are located in [/tests/bench](https://github.com/ot Solana version: 2.3.0 -| Instruction | Stack Memory | - | -| ------------------------------ | ------------ | --- | -| account_info1 | 46 | - | -| account_info2 | 88 | - | -| account_info4 | 88 | - | -| account_info8 | 88 | - | -| account_empty_init1 | 88 | - | -| account_empty_init2 | 88 | - | -| account_empty_init4 | 88 | - | -| account_empty_init8 | 88 | - | -| account_empty1 | 88 | - | -| account_empty2 | 88 | - | -| account_empty4 | 88 | - | -| account_empty8 | 88 | - | -| account_sized_init1 | 88 | - | -| account_sized_init2 | 88 | - | -| account_sized_init4 | 88 | - | -| account_sized_init8 | 88 | - | -| account_sized1 | 88 | - | -| account_sized2 | 88 | - | -| account_sized4 | 88 | - | -| account_sized8 | 88 | - | -| account_unsized_init1 | 88 | - | -| account_unsized_init2 | 88 | - | -| account_unsized_init4 | 88 | - | -| account_unsized_init8 | 88 | - | -| account_unsized1 | 88 | - | -| account_unsized2 | 88 | - | -| account_unsized4 | 88 | - | -| account_unsized8 | 88 | - | -| boxed_account_empty_init1 | 88 | - | -| boxed_account_empty_init2 | 88 | - | -| boxed_account_empty_init4 | 88 | - | -| boxed_account_empty_init8 | 88 | - | -| boxed_account_empty1 | 88 | - | -| boxed_account_empty2 | 88 | - | -| boxed_account_empty4 | 88 | - | -| boxed_account_empty8 | 96 | - | -| boxed_account_sized_init1 | 88 | - | -| boxed_account_sized_init2 | 88 | - | -| boxed_account_sized_init4 | 88 | - | -| boxed_account_sized_init8 | 88 | - | -| boxed_account_sized1 | 88 | - | -| boxed_account_sized2 | 88 | - | -| boxed_account_sized4 | 88 | - | -| boxed_account_sized8 | 96 | - | -| boxed_account_unsized_init1 | 88 | - | -| boxed_account_unsized_init2 | 88 | - | -| boxed_account_unsized_init4 | 88 | - | -| boxed_account_unsized_init8 | 88 | - | -| boxed_account_unsized1 | 88 | - | -| boxed_account_unsized2 | 88 | - | -| boxed_account_unsized4 | 88 | - | -| boxed_account_unsized8 | 96 | - | -| boxed_interface_account_mint1 | 88 | - | -| boxed_interface_account_mint2 | 88 | - | -| boxed_interface_account_mint4 | 88 | - | -| boxed_interface_account_mint8 | 96 | - | -| boxed_interface_account_token1 | 88 | - | -| boxed_interface_account_token2 | 88 | - | -| boxed_interface_account_token4 | 88 | - | -| boxed_interface_account_token8 | 96 | - | -| interface_account_mint1 | 88 | - | -| interface_account_mint2 | 88 | - | -| interface_account_mint4 | 88 | - | -| interface_account_mint8 | 88 | - | -| interface_account_token1 | 104 | - | -| interface_account_token2 | 104 | - | -| interface_account_token4 | 104 | - | -| interface1 | 88 | - | -| interface2 | 88 | - | -| interface4 | 88 | - | -| interface8 | 88 | - | -| program1 | 88 | - | -| program2 | 88 | - | -| program4 | 88 | - | -| program8 | 88 | - | -| signer1 | 88 | - | -| signer2 | 88 | - | -| signer4 | 88 | - | -| signer8 | 88 | - | -| system_account1 | 88 | - | -| system_account2 | 88 | - | -| system_account4 | 88 | - | -| system_account8 | 88 | - | -| unchecked_account1 | 88 | - | -| unchecked_account2 | 88 | - | -| unchecked_account4 | 88 | - | -| unchecked_account8 | 88 | - | +| Instruction | Stack Memory | - | +| ------------------------------ | ------------ | ------------------- | +| account_info1 | 88 | 🔴 **+42 (91.30%)** | +| account_info2 | 88 | - | +| account_info4 | 88 | - | +| account_info8 | 88 | - | +| account_empty_init1 | 88 | - | +| account_empty_init2 | 88 | - | +| account_empty_init4 | 88 | - | +| account_empty_init8 | 88 | - | +| account_empty1 | 88 | - | +| account_empty2 | 88 | - | +| account_empty4 | 88 | - | +| account_empty8 | 88 | - | +| account_sized_init1 | 88 | - | +| account_sized_init2 | 88 | - | +| account_sized_init4 | 88 | - | +| account_sized_init8 | 88 | - | +| account_sized1 | 88 | - | +| account_sized2 | 88 | - | +| account_sized4 | 88 | - | +| account_sized8 | 88 | - | +| account_unsized_init1 | 88 | - | +| account_unsized_init2 | 88 | - | +| account_unsized_init4 | 88 | - | +| account_unsized_init8 | 88 | - | +| account_unsized1 | 88 | - | +| account_unsized2 | 88 | - | +| account_unsized4 | 88 | - | +| account_unsized8 | 88 | - | +| boxed_account_empty_init1 | 88 | - | +| boxed_account_empty_init2 | 88 | - | +| boxed_account_empty_init4 | 88 | - | +| boxed_account_empty_init8 | 88 | - | +| boxed_account_empty1 | 88 | - | +| boxed_account_empty2 | 88 | - | +| boxed_account_empty4 | 88 | - | +| boxed_account_empty8 | 96 | - | +| boxed_account_sized_init1 | 88 | - | +| boxed_account_sized_init2 | 88 | - | +| boxed_account_sized_init4 | 88 | - | +| boxed_account_sized_init8 | 88 | - | +| boxed_account_sized1 | 88 | - | +| boxed_account_sized2 | 88 | - | +| boxed_account_sized4 | 88 | - | +| boxed_account_sized8 | 96 | - | +| boxed_account_unsized_init1 | 88 | - | +| boxed_account_unsized_init2 | 88 | - | +| boxed_account_unsized_init4 | 88 | - | +| boxed_account_unsized_init8 | 88 | - | +| boxed_account_unsized1 | 88 | - | +| boxed_account_unsized2 | 88 | - | +| boxed_account_unsized4 | 88 | - | +| boxed_account_unsized8 | 96 | - | +| boxed_interface_account_mint1 | 88 | - | +| boxed_interface_account_mint2 | 88 | - | +| boxed_interface_account_mint4 | 88 | - | +| boxed_interface_account_mint8 | 96 | - | +| boxed_interface_account_token1 | 88 | - | +| boxed_interface_account_token2 | 88 | - | +| boxed_interface_account_token4 | 88 | - | +| boxed_interface_account_token8 | 96 | - | +| interface_account_mint1 | 88 | - | +| interface_account_mint2 | 88 | - | +| interface_account_mint4 | 88 | - | +| interface_account_mint8 | 88 | - | +| interface_account_token1 | 104 | - | +| interface_account_token2 | 104 | - | +| interface_account_token4 | 104 | - | +| interface1 | 88 | - | +| interface2 | 88 | - | +| interface4 | 88 | - | +| interface8 | 88 | - | +| program1 | 88 | - | +| program2 | 88 | - | +| program4 | 88 | - | +| program8 | 88 | - | +| signer1 | 88 | - | +| signer2 | 88 | - | +| signer4 | 88 | - | +| signer8 | 88 | - | +| system_account1 | 88 | - | +| system_account2 | 88 | - | +| system_account4 | 88 | - | +| system_account8 | 88 | - | +| unchecked_account1 | 88 | - | +| unchecked_account2 | 88 | - | +| unchecked_account4 | 88 | - | +| unchecked_account8 | 88 | - | ### Notable changes diff --git a/lang/attribute/program/src/declare_program/mods/internal.rs b/lang/attribute/program/src/declare_program/mods/internal.rs index 364c278503..455810dd6f 100644 --- a/lang/attribute/program/src/declare_program/mods/internal.rs +++ b/lang/attribute/program/src/declare_program/mods/internal.rs @@ -167,9 +167,9 @@ fn gen_internal_accounts_common( }; let acc_expr = if acc.optional { - quote! { Option } + quote! { Option } } else { - quote! { AccountInfo #generics } + quote! { UncheckedAccount #generics } }; quote! { diff --git a/lang/derive/accounts/src/lib.rs b/lang/derive/accounts/src/lib.rs index d90fe69ed2..ac8f1c2a92 100644 --- a/lang/derive/accounts/src/lib.rs +++ b/lang/derive/accounts/src/lib.rs @@ -63,9 +63,9 @@ use {proc_macro::TokenStream, quote::ToTokens, syn::parse_macro_input}; /// Example: ///

 /// #[account(signer)]
-/// pub authority: AccountInfo<'info>,
+/// pub authority: UncheckedAccount<'info>,
 /// #[account(signer @ MyError::MyErrorCode)]
-/// pub payer: AccountInfo<'info>
+/// pub payer: UncheckedAccount<'info>
 ///                 
/// /// @@ -190,13 +190,13 @@ use {proc_macro::TokenStream, quote::ToTokens, syn::parse_macro_input}; ///         init, payer = payer, ///         space = 8 + 8, owner = other_program.key() ///     )] -///     pub account_for_other_program: AccountInfo<'info>, +///     pub account_for_other_program: UncheckedAccount<'info>, ///     #[account( ///         init, payer = payer, space = 8 + 8, ///         owner = other_program.key(), ///         seeds = [b"other_seed"], bump ///     )] -///     pub pda_for_other_program: AccountInfo<'info>, +///     pub pda_for_other_program: UncheckedAccount<'info>, ///     #[account(mut)] ///     pub payer: Signer<'info>, ///     pub system_program: Program<'info, System>, @@ -271,21 +271,21 @@ use {proc_macro::TokenStream, quote::ToTokens, syn::parse_macro_input}; /// #[instruction(first_bump: u8, second_bump: u8)] /// pub struct Example { /// #[account(seeds = [b"example_seed"], bump)] -/// pub canonical_pda: AccountInfo<'info>, +/// pub canonical_pda: UncheckedAccount<'info>, /// #[account( /// seeds = [b"example_seed"], /// bump, /// seeds::program = other_program.key() /// )] -/// pub canonical_pda_two: AccountInfo<'info>, +/// pub canonical_pda_two: UncheckedAccount<'info>, /// #[account(seeds = [b"other_seed"], bump = first_bump)] -/// pub arbitrary_pda: AccountInfo<'info> +/// pub arbitrary_pda: UncheckedAccount<'info> /// #[account( /// seeds = [b"other_seed"], /// bump = second_bump, /// seeds::program = other_program.key() /// )] -/// pub arbitrary_pda_two: AccountInfo<'info>, +/// pub arbitrary_pda_two: UncheckedAccount<'info>, /// pub other_program: Program<'info, OtherProgram> /// } /// diff --git a/lang/src/accounts/account_loader.rs b/lang/src/accounts/account_loader.rs index 24c9ccca49..f8125b6b7d 100644 --- a/lang/src/accounts/account_loader.rs +++ b/lang/src/accounts/account_loader.rs @@ -81,7 +81,7 @@ use { /// bar: AccountLoader<'info, Bar>, /// #[account(mut)] /// authority: Signer<'info>, -/// system_program: AccountInfo<'info>, +/// system_program: UncheckedAccount<'info>, /// } /// /// #[derive(Accounts)] diff --git a/lang/src/accounts/mod.rs b/lang/src/accounts/mod.rs index f18cd1313d..2269e96da5 100644 --- a/lang/src/accounts/mod.rs +++ b/lang/src/accounts/mod.rs @@ -1,7 +1,8 @@ //! Account types that can be used in the account validation struct. +mod account_info; + pub mod account; -pub mod account_info; pub mod account_loader; pub mod boxed; pub mod interface; diff --git a/lang/src/accounts/unchecked_account.rs b/lang/src/accounts/unchecked_account.rs index d3c8d369fd..a93be46931 100644 --- a/lang/src/accounts/unchecked_account.rs +++ b/lang/src/accounts/unchecked_account.rs @@ -15,7 +15,14 @@ use { #[derive(Debug, Clone)] pub struct UncheckedAccount<'info>(&'info AccountInfo<'info>); +impl<'info> From<&'info AccountInfo<'info>> for UncheckedAccount<'info> { + fn from(value: &'info AccountInfo<'info>) -> Self { + Self(value) + } +} + impl<'info> UncheckedAccount<'info> { + #[deprecated(note = "Use `UncheckedAccount::from` instead; this constructor cannot fail")] pub fn try_from(acc_info: &'info AccountInfo<'info>) -> Self { Self(acc_info) } diff --git a/lang/src/vec.rs b/lang/src/vec.rs index 18078a0068..5c6e4f2df0 100644 --- a/lang/src/vec.rs +++ b/lang/src/vec.rs @@ -41,12 +41,15 @@ impl<'info, B, T: Accounts<'info, B>> Accounts<'info, B> for Vec { #[cfg(test)] mod tests { - use {super::*, crate::solana_program::pubkey::Pubkey}; + use { + super::*, + crate::{accounts::unchecked_account::UncheckedAccount, solana_program::pubkey::Pubkey}, + }; #[derive(Accounts)] pub struct Test<'info> { #[account(signer)] - test: AccountInfo<'info>, + test: UncheckedAccount<'info>, } #[test] diff --git a/lang/syn/src/lib.rs b/lang/syn/src/lib.rs index 096d1f7a0b..423db800cb 100644 --- a/lang/syn/src/lib.rs +++ b/lang/syn/src/lib.rs @@ -452,7 +452,7 @@ impl Field { match &self.ty { Ty::AccountInfo => quote! { #field.to_account_info() }, Ty::UncheckedAccount => { - quote! { UncheckedAccount::try_from(&#field) } + quote! { UncheckedAccount::from(#field) } } Ty::Account(AccountTy { boxed, .. }) | Ty::InterfaceAccount(InterfaceAccountTy { boxed, .. }) => { diff --git a/lang/tests/generics_test.rs b/lang/tests/generics_test.rs index 863eaa3cdd..a6c4452b81 100644 --- a/lang/tests/generics_test.rs +++ b/lang/tests/generics_test.rs @@ -23,7 +23,7 @@ where T: AccountSerialize + AccountDeserialize + Owner + Clone, U: BorshSerialize + BorshDeserialize + Default + Clone, { - pub non_generic: AccountInfo<'info>, + pub non_generic: UncheckedAccount<'info>, pub generic: Account<'info, T>, pub const_generic: AccountLoader<'info, FooAccount>, diff --git a/tests/auction-house/programs/auction-house/src/lib.rs b/tests/auction-house/programs/auction-house/src/lib.rs index a54c8ca86e..8e69349f48 100644 --- a/tests/auction-house/programs/auction-house/src/lib.rs +++ b/tests/auction-house/programs/auction-house/src/lib.rs @@ -1095,7 +1095,7 @@ pub struct CreateAuctionHouse<'info> { treasury_mint: Account<'info, Mint>, #[account(mut)] payer: Signer<'info>, - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account(mut)] fee_withdrawal_destination: UncheckedAccount<'info>, treasury_withdrawal_destination_owner: UncheckedAccount<'info>, @@ -1169,7 +1169,7 @@ pub struct Deposit<'info> { escrow_payment_account: UncheckedAccount<'info>, treasury_mint: Account<'info, Mint>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account( mut, seeds=[ @@ -1224,7 +1224,7 @@ pub struct Withdraw<'info> { escrow_payment_account: UncheckedAccount<'info>, treasury_mint: Account<'info, Mint>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, token_program: Program<'info, Token>, system_program: Program<'info, System>, associated_token_program: Program<'info, AssociatedToken>, @@ -1238,7 +1238,7 @@ pub struct Sell<'info> { token_account: Account<'info, TokenAccount>, metadata: UncheckedAccount<'info>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account( seeds=[ PREFIX.as_bytes(), @@ -1312,7 +1312,7 @@ pub struct Cancel<'info> { #[account(mut)] token_account: Account<'info, TokenAccount>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, treasury_mint: UncheckedAccount<'info>, #[account( seeds=[ @@ -1365,7 +1365,7 @@ pub struct Buy<'info> { token_account: Account<'info, TokenAccount>, metadata: UncheckedAccount<'info>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account( seeds=[ PREFIX.as_bytes(), @@ -1437,7 +1437,7 @@ pub struct ExecuteSale<'info> { #[account(mut)] buyer_receipt_token_account: UncheckedAccount<'info>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account( seeds=[ PREFIX.as_bytes(), diff --git a/tests/bench/bench.json b/tests/bench/bench.json index d1d255489b..682061d4b2 100644 --- a/tests/bench/bench.json +++ b/tests/bench/bench.json @@ -2421,13 +2421,13 @@ "solanaVersion": "2.3.0", "result": { "binarySize": { - "bench": 932992 + "bench": 917416 }, "computeUnits": { - "accountInfo1": 702, - "accountInfo2": 1115, - "accountInfo4": 1921, - "accountInfo8": 3480, + "accountInfo1": 647, + "accountInfo2": 978, + "accountInfo4": 1626, + "accountInfo8": 2922, "accountEmptyInit1": 4716, "accountEmpty1": 738, "accountEmptyInit2": 8379, @@ -2513,7 +2513,7 @@ "uncheckedAccount8": 3171 }, "stackMemory": { - "account_info1": 46, + "account_info1": 88, "account_info2": 88, "account_info4": 88, "account_info8": 88, diff --git a/tests/bench/programs/bench/src/lib.rs b/tests/bench/programs/bench/src/lib.rs index acfa1bd5d6..fbb0021ea5 100644 --- a/tests/bench/programs/bench/src/lib.rs +++ b/tests/bench/programs/bench/src/lib.rs @@ -383,33 +383,33 @@ pub struct Unsized { #[derive(Accounts)] pub struct AccountInfo1<'info> { - pub account1: AccountInfo<'info>, + pub account1: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct AccountInfo2<'info> { - pub account1: AccountInfo<'info>, - pub account2: AccountInfo<'info>, + pub account1: UncheckedAccount<'info>, + pub account2: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct AccountInfo4<'info> { - pub account1: AccountInfo<'info>, - pub account2: AccountInfo<'info>, - pub account3: AccountInfo<'info>, - pub account4: AccountInfo<'info>, + pub account1: UncheckedAccount<'info>, + pub account2: UncheckedAccount<'info>, + pub account3: UncheckedAccount<'info>, + pub account4: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct AccountInfo8<'info> { - pub account1: AccountInfo<'info>, - pub account2: AccountInfo<'info>, - pub account3: AccountInfo<'info>, - pub account4: AccountInfo<'info>, - pub account5: AccountInfo<'info>, - pub account6: AccountInfo<'info>, - pub account7: AccountInfo<'info>, - pub account8: AccountInfo<'info>, + pub account1: UncheckedAccount<'info>, + pub account2: UncheckedAccount<'info>, + pub account3: UncheckedAccount<'info>, + pub account4: UncheckedAccount<'info>, + pub account5: UncheckedAccount<'info>, + pub account6: UncheckedAccount<'info>, + pub account7: UncheckedAccount<'info>, + pub account8: UncheckedAccount<'info>, } #[derive(Accounts)] diff --git a/tests/cashiers-check/programs/cashiers-check/src/lib.rs b/tests/cashiers-check/programs/cashiers-check/src/lib.rs index 77523bb68a..b05bf79fad 100644 --- a/tests/cashiers-check/programs/cashiers-check/src/lib.rs +++ b/tests/cashiers-check/programs/cashiers-check/src/lib.rs @@ -25,7 +25,7 @@ pub mod cashiers_check { let cpi_accounts = Transfer { from: ctx.accounts.from.to_account_info(), to: ctx.accounts.vault.to_account_info(), - authority: ctx.accounts.owner.clone(), + authority: ctx.accounts.owner.to_account_info(), }; let cpi_ctx = CpiContext::new(cpi_program_id, cpi_accounts); token::transfer(cpi_ctx, amount)?; @@ -53,7 +53,7 @@ pub mod cashiers_check { let cpi_accounts = Transfer { from: ctx.accounts.vault.to_account_info(), to: ctx.accounts.to.to_account_info(), - authority: ctx.accounts.check_signer.clone(), + authority: ctx.accounts.check_signer.to_account_info(), }; let cpi_ctx = CpiContext::new_with_signer(cpi_program_id, cpi_accounts, signer); token::transfer(cpi_ctx, ctx.accounts.check.amount)?; @@ -73,7 +73,7 @@ pub mod cashiers_check { let cpi_accounts = Transfer { from: ctx.accounts.vault.to_account_info(), to: ctx.accounts.from.to_account_info(), - authority: ctx.accounts.check_signer.clone(), + authority: ctx.accounts.check_signer.to_account_info(), }; let cpi_ctx = CpiContext::new_with_signer(cpi_program_id, cpi_accounts, signer); token::transfer(cpi_ctx, ctx.accounts.check.amount)?; @@ -91,7 +91,7 @@ pub struct CreateCheck<'info> { #[account(mut, constraint = &vault.owner == check_signer.key)] vault: Account<'info, TokenAccount>, // Program derived address for the check. - check_signer: AccountInfo<'info>, + check_signer: UncheckedAccount<'info>, // Token account the check is made from. #[account(mut, has_one = owner)] from: Account<'info, TokenAccount>, @@ -99,8 +99,8 @@ pub struct CreateCheck<'info> { #[account(constraint = from.mint == to.mint)] to: Account<'info, TokenAccount>, // Owner of the `from` token account. - owner: AccountInfo<'info>, - token_program: AccountInfo<'info>, + owner: UncheckedAccount<'info>, + token_program: UncheckedAccount<'info>, } impl<'info> CreateCheck<'info> { @@ -122,16 +122,16 @@ pub struct CashCheck<'info> { #[account(mut, has_one = vault, has_one = to)] check: Account<'info, Check>, #[account(mut)] - vault: AccountInfo<'info>, + vault: UncheckedAccount<'info>, #[account( seeds = [check.to_account_info().key.as_ref()], bump = check.nonce, )] - check_signer: AccountInfo<'info>, + check_signer: UncheckedAccount<'info>, #[account(mut, has_one = owner)] to: Account<'info, TokenAccount>, owner: Signer<'info>, - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -139,16 +139,16 @@ pub struct CancelCheck<'info> { #[account(mut, has_one = vault, has_one = from)] check: Account<'info, Check>, #[account(mut)] - vault: AccountInfo<'info>, + vault: UncheckedAccount<'info>, #[account( seeds = [check.to_account_info().key.as_ref()], bump = check.nonce, )] - check_signer: AccountInfo<'info>, + check_signer: UncheckedAccount<'info>, #[account(mut, has_one = owner)] from: Account<'info, TokenAccount>, owner: Signer<'info>, - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[account] diff --git a/tests/chat/programs/chat/src/lib.rs b/tests/chat/programs/chat/src/lib.rs index e1b850d19b..5d35fbf5f4 100644 --- a/tests/chat/programs/chat/src/lib.rs +++ b/tests/chat/programs/chat/src/lib.rs @@ -50,7 +50,7 @@ pub struct CreateUser<'info> { user: Account<'info, User>, #[account(mut)] authority: Signer<'info>, - system_program: AccountInfo<'info>, + system_program: UncheckedAccount<'info>, } #[derive(Accounts)] diff --git a/tests/custom-coder/programs/native-system/src/lib.rs b/tests/custom-coder/programs/native-system/src/lib.rs index 8ac2b71574..a6b9774478 100644 --- a/tests/custom-coder/programs/native-system/src/lib.rs +++ b/tests/custom-coder/programs/native-system/src/lib.rs @@ -112,7 +112,7 @@ pub struct Transfer<'info> { from: Signer<'info>, #[account(mut)] /// CHECK: - to: AccountInfo<'info>, + to: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -121,7 +121,7 @@ pub struct CreateAccountWithSeed<'info> { from: Signer<'info>, #[account(mut)] /// CHECK: - to: AccountInfo<'info>, + to: UncheckedAccount<'info>, base: Signer<'info>, } @@ -129,9 +129,9 @@ pub struct CreateAccountWithSeed<'info> { pub struct AdvanceNonceAccount<'info> { #[account(mut)] /// CHECK: - nonce: AccountInfo<'info>, + nonce: UncheckedAccount<'info>, /// CHECK: - recent_blockhashes: AccountInfo<'info>, + recent_blockhashes: UncheckedAccount<'info>, authorized: Signer<'info>, } @@ -139,12 +139,12 @@ pub struct AdvanceNonceAccount<'info> { pub struct WithdrawNonceAccount<'info> { #[account(mut)] /// CHECK: - nonce: AccountInfo<'info>, + nonce: UncheckedAccount<'info>, #[account(mut)] /// CHECK: - to: AccountInfo<'info>, + to: UncheckedAccount<'info>, /// CHECK: - recent_blockhashes: AccountInfo<'info>, + recent_blockhashes: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, authorized: Signer<'info>, } @@ -154,7 +154,7 @@ pub struct InitializeNonceAccount<'info> { #[account(mut)] nonce: Signer<'info>, /// CHECK: - recent_blockhashes: AccountInfo<'info>, + recent_blockhashes: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, } @@ -162,7 +162,7 @@ pub struct InitializeNonceAccount<'info> { pub struct AuthorizeNonceAccount<'info> { #[account(mut)] /// CHECK: - nonce: AccountInfo<'info>, + nonce: UncheckedAccount<'info>, authorized: Signer<'info>, } @@ -176,7 +176,7 @@ pub struct Allocate<'info> { pub struct AllocateWithSeed<'info> { #[account(mut)] /// CHECK: - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, base: Signer<'info>, } @@ -184,7 +184,7 @@ pub struct AllocateWithSeed<'info> { pub struct AssignWithSeed<'info> { #[account(mut)] /// CHECK: - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, base: Signer<'info>, } @@ -192,11 +192,11 @@ pub struct AssignWithSeed<'info> { pub struct TransferWithSeed<'info> { #[account(mut)] /// CHECK: - from: AccountInfo<'info>, + from: UncheckedAccount<'info>, base: Signer<'info>, #[account(mut)] /// CHECK: - to: AccountInfo<'info>, + to: UncheckedAccount<'info>, } #[derive(AnchorSerialize, AnchorDeserialize, Clone)] diff --git a/tests/declare-program/programs/external/src/lib.rs b/tests/declare-program/programs/external/src/lib.rs index b91652cf0a..47af7f5ef9 100644 --- a/tests/declare-program/programs/external/src/lib.rs +++ b/tests/declare-program/programs/external/src/lib.rs @@ -213,7 +213,7 @@ pub struct UpdateWithOptional<'info> { pub my_account: Account<'info, MyAccount>, /// CHECK: Optional account for testing #[account(mut)] - pub optional_account: Option>, + pub optional_account: Option>, } #[account] diff --git a/tests/errors/programs/errors/src/lib.rs b/tests/errors/programs/errors/src/lib.rs index 168015f405..21818c1cad 100644 --- a/tests/errors/programs/errors/src/lib.rs +++ b/tests/errors/programs/errors/src/lib.rs @@ -143,14 +143,14 @@ pub struct Hello {} #[derive(Accounts)] pub struct MutError<'info> { #[account(mut)] - my_account: AccountInfo<'info>, + my_account: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct HasOneError<'info> { #[account(zero, has_one = owner)] my_account: Account<'info, HasOneAccount>, - owner: AccountInfo<'info>, + owner: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -166,7 +166,7 @@ pub struct HasOneAccount { #[derive(Accounts)] pub struct RawCustomError<'info> { #[account(constraint = *my_account.key == ID @ MyError::HelloCustom)] - my_account: AccountInfo<'info>, + my_account: UncheckedAccount<'info>, } #[account] diff --git a/tests/escrow/programs/escrow/src/lib.rs b/tests/escrow/programs/escrow/src/lib.rs index f124be8947..8affe2aacb 100644 --- a/tests/escrow/programs/escrow/src/lib.rs +++ b/tests/escrow/programs/escrow/src/lib.rs @@ -128,7 +128,7 @@ pub struct InitializeEscrow<'info> { pub struct Exchange<'info> { #[account(signer)] /// CHECK: - pub taker: AccountInfo<'info>, + pub taker: UncheckedAccount<'info>, #[account(mut, token::mint = deposit_mint)] pub taker_deposit_token_account: Box>, #[account(mut, token::mint = receive_mint)] @@ -139,7 +139,7 @@ pub struct Exchange<'info> { pub initializer_receive_token_account: Box>, #[account(mut)] /// CHECK: - pub initializer_main_account: AccountInfo<'info>, + pub initializer_main_account: UncheckedAccount<'info>, #[account( mut, constraint = escrow_account.taker_amount <= taker_deposit_token_account.amount, @@ -150,7 +150,7 @@ pub struct Exchange<'info> { )] pub escrow_account: Account<'info, EscrowAccount>, /// CHECK: - pub pda_account: AccountInfo<'info>, + pub pda_account: UncheckedAccount<'info>, pub deposit_mint: Box>, pub receive_mint: Box>, pub deposit_token_program: Interface<'info, TokenInterface>, @@ -160,11 +160,11 @@ pub struct Exchange<'info> { #[derive(Accounts)] pub struct CancelEscrow<'info> { /// CHECK: - pub initializer: AccountInfo<'info>, + pub initializer: UncheckedAccount<'info>, #[account(mut)] pub pda_deposit_token_account: InterfaceAccount<'info, TokenAccount>, /// CHECK: - pub pda_account: AccountInfo<'info>, + pub pda_account: UncheckedAccount<'info>, #[account( mut, constraint = escrow_account.initializer_key == *initializer.key, @@ -193,10 +193,7 @@ impl<'info> From<&mut InitializeEscrow<'info>> { fn from(accounts: &mut InitializeEscrow<'info>) -> Self { let cpi_accounts = SetAuthority { - account_or_mint: accounts - .initializer_deposit_token_account - .to_account_info() - .clone(), + account_or_mint: accounts.initializer_deposit_token_account.to_account_info(), current_authority: accounts.initializer.to_account_info(), }; let cpi_program_id = accounts.token_program.key(); @@ -208,7 +205,7 @@ impl<'info> CancelEscrow<'info> { fn into_set_authority_context(&self) -> CpiContext<'_, '_, '_, 'info, SetAuthority<'info>> { let cpi_accounts = SetAuthority { account_or_mint: self.pda_deposit_token_account.to_account_info(), - current_authority: self.pda_account.clone(), + current_authority: self.pda_account.to_account_info(), }; let cpi_program_id = self.token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -219,7 +216,7 @@ impl<'info> Exchange<'info> { fn into_set_authority_context(&self) -> CpiContext<'_, '_, '_, 'info, SetAuthority<'info>> { let cpi_accounts = SetAuthority { account_or_mint: self.pda_deposit_token_account.to_account_info(), - current_authority: self.pda_account.clone(), + current_authority: self.pda_account.to_account_info(), }; let cpi_program_id = self.receive_token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -234,7 +231,7 @@ impl<'info> Exchange<'info> { from: self.pda_deposit_token_account.to_account_info(), mint: self.receive_mint.to_account_info(), to: self.taker_receive_token_account.to_account_info(), - authority: self.pda_account.clone(), + authority: self.pda_account.to_account_info(), }; let cpi_program_id = self.receive_token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -248,11 +245,8 @@ impl<'info> Exchange<'info> { let cpi_accounts = TransferChecked { from: self.taker_deposit_token_account.to_account_info(), mint: self.deposit_mint.to_account_info(), - to: self - .initializer_receive_token_account - .to_account_info() - .clone(), - authority: self.taker.clone(), + to: self.initializer_receive_token_account.to_account_info(), + authority: self.taker.to_account_info(), }; let cpi_program_id = self.deposit_token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) diff --git a/tests/ido-pool/programs/ido-pool/src/lib.rs b/tests/ido-pool/programs/ido-pool/src/lib.rs index d2e1010275..613515fe29 100644 --- a/tests/ido-pool/programs/ido-pool/src/lib.rs +++ b/tests/ido-pool/programs/ido-pool/src/lib.rs @@ -204,7 +204,7 @@ pub mod ido_pool { if ctx.accounts.user_redeemable.amount == 0 { let cpi_accounts = CloseAccount { account: ctx.accounts.user_redeemable.to_account_info(), - destination: ctx.accounts.user_authority.clone(), + destination: ctx.accounts.user_authority.to_account_info(), authority: ctx.accounts.ido_account.to_account_info(), }; let cpi_ctx = CpiContext::new_with_signer(cpi_program_id, cpi_accounts, signer); @@ -266,7 +266,7 @@ pub mod ido_pool { if ctx.accounts.escrow_usdc.amount == 0 { let cpi_accounts = CloseAccount { account: ctx.accounts.escrow_usdc.to_account_info(), - destination: ctx.accounts.user_authority.clone(), + destination: ctx.accounts.user_authority.to_account_info(), authority: ctx.accounts.ido_account.to_account_info(), }; let cpi_ctx = CpiContext::new_with_signer(cpi_program_id, cpi_accounts, signer); @@ -457,7 +457,7 @@ pub struct ExchangeRedeemableForWatermelon<'info> { pub payer: Signer<'info>, // User Accounts #[account(mut)] // Sol rent from empty redeemable account is refunded to the user - pub user_authority: AccountInfo<'info>, + pub user_authority: UncheckedAccount<'info>, // TODO replace with ATA constraints #[account(mut, constraint = user_watermelon.owner == user_authority.key(), @@ -520,7 +520,7 @@ pub struct WithdrawFromEscrow<'info> { pub payer: Signer<'info>, // User Accounts #[account(mut)] - pub user_authority: AccountInfo<'info>, + pub user_authority: UncheckedAccount<'info>, #[account(mut, constraint = user_usdc.owner == user_authority.key(), constraint = user_usdc.mint == usdc_mint.key())] diff --git a/tests/lockup/programs/lockup/src/lib.rs b/tests/lockup/programs/lockup/src/lib.rs index 62ed301b74..ce2959b7c1 100644 --- a/tests/lockup/programs/lockup/src/lib.rs +++ b/tests/lockup/programs/lockup/src/lib.rs @@ -204,7 +204,7 @@ pub mod lockup { #[derive(Accounts)] pub struct Auth<'info> { #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -216,12 +216,12 @@ pub struct CreateVesting<'info> { pub vault: Account<'info, TokenAccount>, // Depositor. #[account(mut)] - pub depositor: AccountInfo<'info>, + pub depositor: UncheckedAccount<'info>, #[account(signer)] - pub depositor_authority: AccountInfo<'info>, + pub depositor_authority: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - pub token_program: AccountInfo<'info>, + pub token_program: UncheckedAccount<'info>, pub clock: Sysvar<'info, Clock>, } @@ -257,13 +257,13 @@ pub struct Withdraw<'info> { seeds = [vesting.to_account_info().key.as_ref()], bump = vesting.nonce, )] - vesting_signer: AccountInfo<'info>, + vesting_signer: UncheckedAccount<'info>, // Withdraw receiving target.. #[account(mut)] token: Account<'info, TokenAccount>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } @@ -281,7 +281,7 @@ pub struct WhitelistDeposit<'info> { pub struct WhitelistTransfer<'info> { lockup: ProgramState<'info, Lockup>, beneficiary: Signer<'info>, - whitelisted_program: AccountInfo<'info>, + whitelisted_program: UncheckedAccount<'info>, // Whitelist interface. #[account(mut, has_one = beneficiary, has_one = vault)] @@ -292,12 +292,12 @@ pub struct WhitelistTransfer<'info> { seeds = [vesting.to_account_info().key.as_ref()], bump = vesting.nonce, )] - vesting_signer: AccountInfo<'info>, + vesting_signer: UncheckedAccount<'info>, #[account("token_program.key == &token::ID")] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, #[account(mut)] - whitelisted_program_vault: AccountInfo<'info>, - whitelisted_program_vault_authority: AccountInfo<'info>, + whitelisted_program_vault: UncheckedAccount<'info>, + whitelisted_program_vault_authority: UncheckedAccount<'info>, } #[derive(Accounts)] diff --git a/tests/lockup/programs/registry/src/lib.rs b/tests/lockup/programs/registry/src/lib.rs index caafc1c3f5..5719897ce5 100644 --- a/tests/lockup/programs/registry/src/lib.rs +++ b/tests/lockup/programs/registry/src/lib.rs @@ -616,10 +616,10 @@ pub struct CreateMember<'info> { "balances_locked.vault.mint == registrar.mint" )] balances_locked: BalanceSandboxAccounts<'info>, - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, // Misc. #[account("token_program.key == &token::ID")] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } impl<'info> CreateMember<'info> { @@ -662,7 +662,7 @@ pub struct BalanceSandboxAccounts<'info> { #[derive(Accounts)] pub struct Ctor<'info> { - lockup_program: AccountInfo<'info>, + lockup_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -698,12 +698,12 @@ pub struct Deposit<'info> { vault: Account<'info, TokenAccount>, // Depositor. #[account(mut)] - depositor: AccountInfo<'info>, + depositor: UncheckedAccount<'info>, #[account(signer, constraint = depositor_authority.key == &member.beneficiary)] - depositor_authority: AccountInfo<'info>, + depositor_authority: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -715,12 +715,12 @@ pub struct DepositLocked<'info> { )] vesting: Box>, #[account(mut, constraint = vesting_vault.key == &vesting.vault)] - vesting_vault: AccountInfo<'info>, + vesting_vault: UncheckedAccount<'info>, // Note: no need to verify the depositor_authority since the SPL program // will fail the transaction if it's not correct. pub depositor_authority: Signer<'info>, #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, #[account( mut, constraint = member_vault.to_account_info().key == &member.balances_locked.vault @@ -730,7 +730,7 @@ pub struct DepositLocked<'info> { seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, // Program specific. registry: ProgramState<'info, Registry>, @@ -763,17 +763,17 @@ pub struct Stake<'info> { seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, #[account( seeds = [registrar.to_account_info().key.as_ref()], bump = registrar.nonce, )] - registrar_signer: AccountInfo<'info>, + registrar_signer: UncheckedAccount<'info>, // Misc. clock: Sysvar<'info, Clock>, #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -783,7 +783,7 @@ pub struct StartUnstake<'info> { registrar: Account<'info, Registrar>, reward_event_q: Account<'info, RewardQueue>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, // Member. #[account(zero)] @@ -801,11 +801,11 @@ pub struct StartUnstake<'info> { seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } @@ -824,19 +824,19 @@ pub struct EndUnstake<'info> { // // Note: we do the constraints check in the handler, not here. #[account(mut)] - vault: AccountInfo<'info>, + vault: UncheckedAccount<'info>, #[account(mut)] - vault_pw: AccountInfo<'info>, + vault_pw: UncheckedAccount<'info>, #[account( seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -853,13 +853,13 @@ pub struct Withdraw<'info> { seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, // Receiver. #[account(mut)] - depositor: AccountInfo<'info>, + depositor: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -871,10 +871,10 @@ pub struct WithdrawLocked<'info> { )] vesting: Box>, #[account(mut, constraint = vesting_vault.key == &vesting.vault)] - vesting_vault: AccountInfo<'info>, + vesting_vault: UncheckedAccount<'info>, vesting_signer: Signer<'info>, #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, #[account( mut, constraint = member_vault.to_account_info().key == &member.balances_locked.vault @@ -884,7 +884,7 @@ pub struct WithdrawLocked<'info> { seeds = [registrar.to_account_info().key.as_ref(), member.to_account_info().key.as_ref()], bump = member.nonce, )] - member_signer: AccountInfo<'info>, + member_signer: UncheckedAccount<'info>, // Program specific. registry: ProgramState<'info, Registry>, @@ -909,12 +909,12 @@ pub struct DropReward<'info> { vendor_vault: Account<'info, TokenAccount>, // Depositor. #[account(mut)] - depositor: AccountInfo<'info>, + depositor: UncheckedAccount<'info>, #[account(signer)] - depositor_authority: AccountInfo<'info>, + depositor_authority: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } @@ -942,7 +942,7 @@ pub struct ClaimReward<'info> { cmn: ClaimRewardCommon<'info>, // Account to send reward to. #[account(mut)] - to: AccountInfo<'info>, + to: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -950,7 +950,7 @@ pub struct ClaimRewardLocked<'info> { cmn: ClaimRewardCommon<'info>, registry: ProgramState<'info, Registry>, #[account("lockup_program.key == ®istry.lockup_program")] - lockup_program: AccountInfo<'info>, + lockup_program: UncheckedAccount<'info>, } // Accounts common to both claim reward locked/unlocked instructions. @@ -970,15 +970,15 @@ pub struct ClaimRewardCommon<'info> { #[account(has_one = registrar, has_one = vault)] vendor: Account<'info, RewardVendor>, #[account(mut)] - vault: AccountInfo<'info>, + vault: UncheckedAccount<'info>, #[account( seeds = [registrar.to_account_info().key.as_ref(), vendor.to_account_info().key.as_ref()], bump = vendor.nonce, )] - vendor_signer: AccountInfo<'info>, + vendor_signer: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } @@ -995,14 +995,14 @@ pub struct ExpireReward<'info> { seeds = [registrar.to_account_info().key.as_ref(), vendor.to_account_info().key.as_ref()], bump = vendor.nonce )] - vendor_signer: AccountInfo<'info>, + vendor_signer: UncheckedAccount<'info>, // Receiver. expiry_receiver: Signer<'info>, #[account(mut)] - expiry_receiver_token: AccountInfo<'info>, + expiry_receiver_token: UncheckedAccount<'info>, // Misc. #[account(constraint = token_program.key == &token::ID)] - token_program: AccountInfo<'info>, + token_program: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } diff --git a/tests/misc/programs/misc-optional/src/context.rs b/tests/misc/programs/misc-optional/src/context.rs index fcbd761b58..1e4d1efb0c 100644 --- a/tests/misc/programs/misc-optional/src/context.rs +++ b/tests/misc/programs/misc-optional/src/context.rs @@ -26,7 +26,7 @@ pub struct TestTokenSeedsInit<'info> { pub my_pda: Option>, #[account(mut)] /// CHECK: - pub authority: Option>, + pub authority: Option>, pub system_program: Option>, pub token_program: Option>, } @@ -62,7 +62,7 @@ pub struct TestInitAssociatedTokenWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub associated_token_token_program: Option>, + pub associated_token_token_program: Option>, pub associated_token_program: Option>, } @@ -75,7 +75,7 @@ pub struct TestValidateAssociatedToken<'info> { pub token: Option>, pub mint: Option>, /// CHECK: - pub wallet: Option>, + pub wallet: Option>, } #[derive(Accounts)] @@ -86,9 +86,9 @@ pub struct TestInstructionConstraint<'info> { bump = nonce, )] /// CHECK: - pub my_pda: Option>, + pub my_pda: Option>, /// CHECK: - pub my_account: Option>, + pub my_account: Option>, } #[derive(Accounts)] @@ -105,7 +105,7 @@ pub struct TestPdaInit<'info> { #[account(mut)] pub my_payer: Option>, /// CHECK: - pub foo: Option>, + pub foo: Option>, pub system_program: Option>, } @@ -133,7 +133,7 @@ pub struct TestPdaMutZeroCopy<'info> { )] pub my_pda: Option>, /// CHECK: - pub my_payer: Option>, + pub my_payer: Option>, } #[derive(Accounts)] @@ -151,23 +151,23 @@ pub struct InitializeSkipRentExempt<'info> { #[derive(Accounts)] pub struct InitializeNoRentExempt<'info> { /// CHECK: - pub data: Option>, + pub data: Option>, } #[derive(Accounts)] pub struct TestOwner<'info> { #[account(owner = *misc.key)] /// CHECK: - pub data: Option>, + pub data: Option>, /// CHECK: - pub misc: AccountInfo<'info>, + pub misc: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct TestExecutable<'info> { #[account(executable)] /// CHECK: - pub program: Option>, + pub program: Option>, } #[derive(Accounts)] @@ -175,7 +175,7 @@ pub struct TestClose<'info> { #[account(mut, close = sol_dest)] pub data: Option>, /// CHECK: - sol_dest: Option>, + sol_dest: Option>, } #[derive(Accounts)] @@ -183,7 +183,7 @@ pub struct TestCloseTwice<'info> { #[account(mut, close = sol_dest)] pub data: Option>, /// CHECK: - pub sol_dest: Option>, + pub sol_dest: Option>, } #[derive(Accounts)] @@ -191,7 +191,7 @@ pub struct TestCloseMut<'info> { #[account(mut)] pub data: Option>, /// CHECK: - pub sol_dest: Option>, + pub sol_dest: Option>, } #[derive(Accounts)] @@ -248,7 +248,7 @@ pub struct TestInitMintWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub mint_token_program: Option>, + pub mint_token_program: Option>, } #[derive(Accounts)] @@ -276,7 +276,7 @@ pub struct TestInitTokenWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub token_token_program: Option>, + pub token_token_program: Option>, } #[derive(Accounts)] @@ -301,7 +301,7 @@ pub struct TestInitWithEmptySeeds<'info> { pub struct TestEmptySeedsConstraint<'info> { #[account(seeds = [], bump)] /// CHECK: - pub pda: Option>, + pub pda: Option>, } #[derive(Accounts)] @@ -332,7 +332,7 @@ pub struct TestInitIfNeededChecksOwner<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: - pub owner: AccountInfo<'info>, + pub owner: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -356,9 +356,9 @@ pub struct TestInitMintIfNeeded<'info> { pub system_program: Option>, pub token_program: Option>, /// CHECK: - pub mint_authority: Option>, + pub mint_authority: Option>, /// CHECK: - pub freeze_authority: Option>, + pub freeze_authority: Option>, } #[derive(Accounts)] @@ -375,11 +375,11 @@ pub struct TestInitMintIfNeededWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub mint_token_program: Option>, + pub mint_token_program: Option>, /// CHECK: ignore - pub mint_authority: Option>, + pub mint_authority: Option>, /// CHECK: ignore - pub freeze_authority: Option>, + pub freeze_authority: Option>, } #[derive(Accounts)] @@ -392,7 +392,7 @@ pub struct TestInitTokenIfNeeded<'info> { pub system_program: Option>, pub token_program: Option>, /// CHECK: - pub authority: Option>, + pub authority: Option>, } #[derive(Accounts)] @@ -409,9 +409,9 @@ pub struct TestInitTokenIfNeededWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub token_token_program: Option>, + pub token_token_program: Option>, /// CHECK: - pub authority: Option>, + pub authority: Option>, } #[derive(Accounts)] @@ -429,7 +429,7 @@ pub struct TestInitAssociatedTokenIfNeeded<'info> { pub token_program: Option>, pub associated_token_program: Option>, /// CHECK: - pub authority: Option>, + pub authority: Option>, } #[derive(Accounts)] @@ -446,10 +446,10 @@ pub struct TestInitAssociatedTokenIfNeededWithTokenProgram<'info> { pub payer: Option>, pub system_program: Option>, /// CHECK: ignore - pub associated_token_token_program: Option>, + pub associated_token_token_program: Option>, pub associated_token_program: Option>, /// CHECK: ignore - pub authority: Option>, + pub authority: Option>, } #[derive(Accounts)] @@ -479,21 +479,21 @@ pub struct TestMultidimensionalArrayConstSizes<'info> { #[derive(Accounts)] pub struct NoRentExempt<'info> { /// CHECK: - pub data: Option>, + pub data: Option>, } #[derive(Accounts)] pub struct EnforceRentExempt<'info> { #[account(rent_exempt = enforce)] /// CHECK: - pub data: Option>, + pub data: Option>, } #[derive(Accounts)] pub struct InitDecreaseLamports<'info> { #[account(init, payer = user, space = 1000)] /// CHECK: - pub data: Option>, + pub data: Option>, #[account(mut)] pub user: Option>, pub system_program: Option>, @@ -503,7 +503,7 @@ pub struct InitDecreaseLamports<'info> { pub struct InitIfNeededChecksRentExemption<'info> { #[account(init_if_needed, payer = user, space = 1000)] /// CHECK: - pub data: Option>, + pub data: Option>, #[account(mut)] pub user: Option>, pub system_program: Option>, @@ -516,11 +516,11 @@ pub struct TestProgramIdConstraint<'info> { // just deriving like this for testing purposes #[account(seeds = [b"seed"], bump = bump, seeds::program = anchor_spl::associated_token::ID)] /// CHECK: - first: Option>, + first: Option>, #[account(seeds = [b"seed"], bump = second_bump, seeds::program = crate::ID)] /// CHECK: - second: Option>, + second: Option>, } #[derive(Accounts)] @@ -529,11 +529,11 @@ pub struct TestProgramIdConstraintUsingFindPda<'info> { // just deriving like this for testing purposes #[account(seeds = [b"seed"], bump, seeds::program = anchor_spl::associated_token::ID)] /// CHECK: - first: Option>, + first: Option>, #[account(seeds = [b"seed"], bump, seeds::program = crate::ID)] /// CHECK: - second: Option>, + second: Option>, } #[derive(Accounts)] @@ -575,7 +575,7 @@ pub struct TestAuthorityConstraint<'info> { )] pub token: Option>, pub mint: Option>, - pub fake_authority: Option>, + pub fake_authority: Option>, } #[derive(Accounts)] pub struct TestOnlyAuthorityConstraint<'info> { @@ -593,7 +593,7 @@ pub struct TestOnlyTokenProgramConstraint<'info> { token::token_program = token_token_program )] pub token: Option>, - pub token_token_program: Option>, + pub token_token_program: Option>, } #[derive(Accounts)] @@ -614,8 +614,8 @@ pub struct TestMintConstraint<'info> { mint::freeze_authority = freeze_authority )] pub mint: Option>, - pub mint_authority: Option>, - pub freeze_authority: Option>, + pub mint_authority: Option>, + pub freeze_authority: Option>, } #[derive(Accounts)] @@ -634,8 +634,8 @@ pub struct TestMintAuthorityConstraint<'info> { mint::freeze_authority = freeze_authority )] pub mint: Option>, - pub mint_authority: Option>, - pub freeze_authority: Option>, + pub mint_authority: Option>, + pub freeze_authority: Option>, } #[derive(Accounts)] @@ -644,7 +644,7 @@ pub struct TestMintOneAuthorityConstraint<'info> { mint::authority = mint_authority, )] pub mint: Option>, - pub mint_authority: Option>, + pub mint_authority: Option>, } #[derive(Accounts)] @@ -655,7 +655,7 @@ pub struct TestMintMissMintAuthConstraint<'info> { mint::freeze_authority = freeze_authority, )] pub mint: Option>, - pub freeze_authority: Option>, + pub freeze_authority: Option>, } #[derive(Accounts)] @@ -665,7 +665,7 @@ pub struct TestMintOnlyTokenProgramConstraint<'info> { )] pub mint: Option>, /// CHECK: ignore - pub mint_token_program: Option>, + pub mint_token_program: Option>, } #[derive(Accounts)] @@ -676,7 +676,7 @@ pub struct TestAssociatedToken<'info> { )] pub token: Option>, pub mint: Option>, - pub authority: Option>, + pub authority: Option>, } #[derive(Accounts)] @@ -689,9 +689,9 @@ pub struct TestAssociatedTokenWithTokenProgramConstraint<'info> { pub token: Option>, pub mint: InterfaceAccount<'info, MintInterface>, /// CHECK: ignore - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, /// CHECK: ignore - pub associated_token_token_program: Option>, + pub associated_token_token_program: Option>, } #[derive(Accounts)] diff --git a/tests/misc/programs/misc/src/context.rs b/tests/misc/programs/misc/src/context.rs index 7fb3571409..fa6c020b91 100644 --- a/tests/misc/programs/misc/src/context.rs +++ b/tests/misc/programs/misc/src/context.rs @@ -27,7 +27,7 @@ pub struct TestTokenSeedsInit<'info> { pub my_pda: Account<'info, TokenAccount>, #[account(mut)] /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, pub system_program: Program<'info, System>, pub token_program: Program<'info, Token>, } @@ -64,7 +64,7 @@ pub struct TestInitAssociatedTokenWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub associated_token_token_program: AccountInfo<'info>, + pub associated_token_token_program: UncheckedAccount<'info>, pub associated_token_program: Program<'info, AssociatedToken>, } @@ -77,7 +77,7 @@ pub struct TestValidateAssociatedToken<'info> { pub token: Account<'info, TokenAccount>, pub mint: Account<'info, Mint>, /// CHECK: - pub wallet: AccountInfo<'info>, + pub wallet: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -88,9 +88,9 @@ pub struct TestInstructionConstraint<'info> { bump = nonce, )] /// CHECK: - pub my_pda: AccountInfo<'info>, + pub my_pda: UncheckedAccount<'info>, /// CHECK: - pub my_account: AccountInfo<'info>, + pub my_account: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -107,7 +107,7 @@ pub struct TestPdaInit<'info> { #[account(mut)] pub my_payer: Signer<'info>, /// CHECK: - pub foo: AccountInfo<'info>, + pub foo: UncheckedAccount<'info>, pub system_program: Program<'info, System>, } @@ -135,7 +135,7 @@ pub struct TestPdaMutZeroCopy<'info> { )] pub my_pda: AccountLoader<'info, DataZeroCopy>, /// CHECK: - pub my_payer: AccountInfo<'info>, + pub my_payer: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -159,23 +159,23 @@ pub struct InitializeSkipRentExempt<'info> { #[derive(Accounts)] pub struct InitializeNoRentExempt<'info> { /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct TestOwner<'info> { #[account(owner = *misc.key)] /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, /// CHECK: - pub misc: AccountInfo<'info>, + pub misc: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct TestExecutable<'info> { #[account(executable)] /// CHECK: - pub program: AccountInfo<'info>, + pub program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -183,7 +183,7 @@ pub struct TestClose<'info> { #[account(mut, close = sol_dest)] pub data: Account<'info, Data>, /// CHECK: - sol_dest: AccountInfo<'info>, + sol_dest: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -191,7 +191,7 @@ pub struct TestCloseTwice<'info> { #[account(mut, close = sol_dest)] pub data: Account<'info, Data>, /// CHECK: - pub sol_dest: AccountInfo<'info>, + pub sol_dest: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -199,7 +199,7 @@ pub struct TestCloseMut<'info> { #[account(mut)] pub data: Account<'info, Data>, /// CHECK: - pub sol_dest: AccountInfo<'info>, + pub sol_dest: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -247,7 +247,7 @@ pub struct TestInitMintWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub mint_token_program: AccountInfo<'info>, + pub mint_token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -275,7 +275,7 @@ pub struct TestInitTokenWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub token_token_program: AccountInfo<'info>, + pub token_token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -308,7 +308,7 @@ pub struct TestInitWithEmptySeeds<'info> { pub struct TestEmptySeedsConstraint<'info> { #[account(seeds = [], bump)] /// CHECK: - pub pda: AccountInfo<'info>, + pub pda: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -339,7 +339,7 @@ pub struct TestInitIfNeededChecksOwner<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: - pub owner: AccountInfo<'info>, + pub owner: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -363,9 +363,9 @@ pub struct TestInitMintIfNeeded<'info> { pub system_program: Program<'info, System>, pub token_program: Program<'info, Token>, /// CHECK: - pub mint_authority: AccountInfo<'info>, + pub mint_authority: UncheckedAccount<'info>, /// CHECK: - pub freeze_authority: AccountInfo<'info>, + pub freeze_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -382,11 +382,11 @@ pub struct TestInitMintIfNeededWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub mint_token_program: AccountInfo<'info>, + pub mint_token_program: UncheckedAccount<'info>, /// CHECK: ignore - pub mint_authority: AccountInfo<'info>, + pub mint_authority: UncheckedAccount<'info>, /// CHECK: ignore - pub freeze_authority: AccountInfo<'info>, + pub freeze_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -399,7 +399,7 @@ pub struct TestInitTokenIfNeeded<'info> { pub system_program: Program<'info, System>, pub token_program: Program<'info, Token>, /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -416,9 +416,9 @@ pub struct TestInitTokenIfNeededWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub token_token_program: AccountInfo<'info>, + pub token_token_program: UncheckedAccount<'info>, /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -436,7 +436,7 @@ pub struct TestInitAssociatedTokenIfNeeded<'info> { pub token_program: Program<'info, Token>, pub associated_token_program: Program<'info, AssociatedToken>, /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -453,10 +453,10 @@ pub struct TestInitAssociatedTokenIfNeededWithTokenProgram<'info> { pub payer: Signer<'info>, pub system_program: Program<'info, System>, /// CHECK: ignore - pub associated_token_token_program: AccountInfo<'info>, + pub associated_token_token_program: UncheckedAccount<'info>, pub associated_token_program: Program<'info, AssociatedToken>, /// CHECK: ignore - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -486,21 +486,21 @@ pub struct TestMultidimensionalArrayConstSizes<'info> { #[derive(Accounts)] pub struct NoRentExempt<'info> { /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct EnforceRentExempt<'info> { #[account(rent_exempt = enforce)] /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InitDecreaseLamports<'info> { #[account(init, payer = user, space = 1000)] /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>, @@ -510,7 +510,7 @@ pub struct InitDecreaseLamports<'info> { pub struct InitIfNeededChecksRentExemption<'info> { #[account(init_if_needed, payer = user, space = 1000)] /// CHECK: - pub data: AccountInfo<'info>, + pub data: UncheckedAccount<'info>, #[account(mut)] pub user: Signer<'info>, pub system_program: Program<'info, System>, @@ -523,11 +523,11 @@ pub struct TestProgramIdConstraint<'info> { // just deriving like this for testing purposes #[account(seeds = [b"seed"], bump = bump, seeds::program = anchor_spl::associated_token::ID)] /// CHECK: - first: AccountInfo<'info>, + first: UncheckedAccount<'info>, #[account(seeds = [b"seed"], bump = second_bump, seeds::program = crate::ID)] /// CHECK: - second: AccountInfo<'info>, + second: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -536,11 +536,11 @@ pub struct TestProgramIdConstraintUsingFindPda<'info> { // just deriving like this for testing purposes #[account(seeds = [b"seed"], bump, seeds::program = anchor_spl::associated_token::ID)] /// CHECK: - first: AccountInfo<'info>, + first: UncheckedAccount<'info>, #[account(seeds = [b"seed"], bump, seeds::program = crate::ID)] /// CHECK: - second: AccountInfo<'info>, + second: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -583,7 +583,7 @@ pub struct TestAuthorityConstraint<'info> { pub token: Account<'info, TokenAccount>, pub mint: Account<'info, Mint>, /// CHECK: ignore - pub fake_authority: AccountInfo<'info>, + pub fake_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -603,7 +603,7 @@ pub struct TestOnlyTokenProgramConstraint<'info> { )] pub token: Account<'info, TokenAccount>, /// CHECK: ignore - pub token_token_program: AccountInfo<'info>, + pub token_token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -625,9 +625,9 @@ pub struct TestMintConstraint<'info> { )] pub mint: Account<'info, Mint>, /// CHECK: ignore - pub mint_authority: AccountInfo<'info>, + pub mint_authority: UncheckedAccount<'info>, /// CHECK: ignore - pub freeze_authority: AccountInfo<'info>, + pub freeze_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -647,9 +647,9 @@ pub struct TestMintAuthorityConstraint<'info> { )] pub mint: Account<'info, Mint>, /// CHECK: ignore - pub mint_authority: AccountInfo<'info>, + pub mint_authority: UncheckedAccount<'info>, /// CHECK: ignore - pub freeze_authority: AccountInfo<'info>, + pub freeze_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -659,7 +659,7 @@ pub struct TestMintOneAuthorityConstraint<'info> { )] pub mint: Account<'info, Mint>, /// CHECK: ignore - pub mint_authority: AccountInfo<'info>, + pub mint_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -671,7 +671,7 @@ pub struct TestMintMissMintAuthConstraint<'info> { )] pub mint: Account<'info, Mint>, /// CHECK: ignore - pub freeze_authority: AccountInfo<'info>, + pub freeze_authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -681,7 +681,7 @@ pub struct TestMintOnlyTokenProgramConstraint<'info> { )] pub mint: Account<'info, Mint>, /// CHECK: ignore - pub mint_token_program: AccountInfo<'info>, + pub mint_token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -693,7 +693,7 @@ pub struct TestAssociatedToken<'info> { pub token: Account<'info, TokenAccount>, pub mint: Account<'info, Mint>, /// CHECK: ignore - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -706,9 +706,9 @@ pub struct TestAssociatedTokenWithTokenProgramConstraint<'info> { pub token: InterfaceAccount<'info, TokenAccountInterface>, pub mint: InterfaceAccount<'info, MintInterface>, /// CHECK: ignore - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, /// CHECK: ignore - pub associated_token_token_program: AccountInfo<'info>, + pub associated_token_token_program: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -726,32 +726,32 @@ pub struct TestUsedIdentifiers<'info> { constraint = 4 == remaining_accounts, )] /// CHECK: ignore - pub test: AccountInfo<'info>, + pub test: UncheckedAccount<'info>, #[account( seeds = [&[program_id], &[accounts], &[ix_data], &[remaining_accounts]], bump = program_id, )] /// CHECK: ignore - pub test1: AccountInfo<'info>, + pub test1: UncheckedAccount<'info>, #[account( seeds = [&[program_id], &[accounts], &[ix_data], &[remaining_accounts]], bump = accounts, )] /// CHECK: ignore - pub test2: AccountInfo<'info>, + pub test2: UncheckedAccount<'info>, #[account( seeds = [&[program_id], &[accounts], &[ix_data], &[remaining_accounts]], bump = ix_data, )] /// CHECK: ignore - pub test3: AccountInfo<'info>, + pub test3: UncheckedAccount<'info>, #[account( seeds = [&[program_id], &[accounts], &[ix_data], &[remaining_accounts]], bump = remaining_accounts, )] /// CHECK: ignore - pub test4: AccountInfo<'info>, + pub test4: UncheckedAccount<'info>, } #[derive(Accounts)] diff --git a/tests/multisig/programs/multisig/src/lib.rs b/tests/multisig/programs/multisig/src/lib.rs index 847161cc4a..448153727b 100644 --- a/tests/multisig/programs/multisig/src/lib.rs +++ b/tests/multisig/programs/multisig/src/lib.rs @@ -197,7 +197,7 @@ pub struct Auth<'info> { seeds = [multisig.to_account_info().key.as_ref()], bump = multisig.nonce, )] - multisig_signer: AccountInfo<'info>, + multisig_signer: UncheckedAccount<'info>, } #[derive(Accounts)] @@ -207,7 +207,7 @@ pub struct ExecuteTransaction<'info> { seeds = [multisig.to_account_info().key.as_ref()], bump = multisig.nonce, )] - multisig_signer: AccountInfo<'info>, + multisig_signer: UncheckedAccount<'info>, #[account(mut, has_one = multisig)] transaction: Account<'info, Transaction>, } diff --git a/tests/pda-derivation/programs/pda-derivation/src/lib.rs b/tests/pda-derivation/programs/pda-derivation/src/lib.rs index 6d27afa42b..e8d5adb71e 100644 --- a/tests/pda-derivation/programs/pda-derivation/src/lib.rs +++ b/tests/pda-derivation/programs/pda-derivation/src/lib.rs @@ -109,7 +109,7 @@ pub struct InitMyAccount<'info> { base: Account<'info, BaseAccount>, // Intentionally using this qualified form instead of importing to test parsing another_base: Account<'info, crate::other::AnotherBaseAccount>, - base2: AccountInfo<'info>, + base2: UncheckedAccount<'info>, #[account( init, payer = payer, @@ -153,7 +153,7 @@ pub struct Nested<'info> { bump, )] /// CHECK: Not needed - account_nested: AccountInfo<'info>, + account_nested: UncheckedAccount<'info>, } #[derive(Accounts)] diff --git a/tests/pyth/programs/pyth/src/lib.rs b/tests/pyth/programs/pyth/src/lib.rs index ff85804237..1a004f09f9 100644 --- a/tests/pyth/programs/pyth/src/lib.rs +++ b/tests/pyth/programs/pyth/src/lib.rs @@ -31,11 +31,11 @@ pub mod pyth { #[derive(Accounts)] pub struct SetPrice<'info> { #[account(mut)] - pub price: AccountInfo<'info>, + pub price: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] - pub price: AccountInfo<'info>, + pub price: UncheckedAccount<'info>, } diff --git a/tests/safety-checks/programs/account-info/src/lib.rs b/tests/safety-checks/programs/account-info/src/lib.rs index 74d8f12182..04b711a6d2 100644 --- a/tests/safety-checks/programs/account-info/src/lib.rs +++ b/tests/safety-checks/programs/account-info/src/lib.rs @@ -12,5 +12,5 @@ pub mod account_info { #[derive(Accounts)] pub struct Initialize<'info> { - unchecked: AccountInfo<'info>, + unchecked: UncheckedAccount<'info>, } diff --git a/tests/safety-checks/programs/ignore-non-accounts/src/lib.rs b/tests/safety-checks/programs/ignore-non-accounts/src/lib.rs index 30f4bea6b1..9e55e84bc5 100644 --- a/tests/safety-checks/programs/ignore-non-accounts/src/lib.rs +++ b/tests/safety-checks/programs/ignore-non-accounts/src/lib.rs @@ -15,16 +15,16 @@ pub struct Initialize<'info> { /// CHECK: checked1: UncheckedAccount<'info>, /// CHECK: - checked2: AccountInfo<'info>, + checked2: UncheckedAccount<'info>, } #[derive(Debug)] pub struct ShouldIgnore1<'info> { unchecked1: UncheckedAccount<'info>, - unchecked2: AccountInfo<'info>, + unchecked2: UncheckedAccount<'info>, } pub struct ShouldIgnore2<'info> { unchecked1: UncheckedAccount<'info>, - unchecked2: AccountInfo<'info>, + unchecked2: UncheckedAccount<'info>, } diff --git a/tests/spl/token-proxy/programs/token-proxy/src/lib.rs b/tests/spl/token-proxy/programs/token-proxy/src/lib.rs index a5e7e2f353..de65fa42d4 100644 --- a/tests/spl/token-proxy/programs/token-proxy/src/lib.rs +++ b/tests/spl/token-proxy/programs/token-proxy/src/lib.rs @@ -28,7 +28,7 @@ mod token_proxy { from: ctx.accounts.from.to_account_info(), mint: mint.to_account_info(), to: ctx.accounts.to.to_account_info(), - authority: ctx.accounts.authority.clone(), + authority: ctx.accounts.authority.to_account_info(), }; let cpi_program_id = token_program.key(); let cpi_context = CpiContext::new(cpi_program_id, cpi_accounts); @@ -37,7 +37,7 @@ mod token_proxy { let cpi_accounts = Transfer { from: ctx.accounts.from.to_account_info(), to: ctx.accounts.to.to_account_info(), - authority: ctx.accounts.authority.clone(), + authority: ctx.accounts.authority.to_account_info(), }; let cpi_program_id = token_program.key(); let cpi_context = CpiContext::new(cpi_program_id, cpi_accounts); @@ -96,7 +96,7 @@ pub enum AuthorityType { pub struct ProxyTransfer<'info> { #[account(signer)] /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, #[account(mut)] pub from: InterfaceAccount<'info, TokenAccount>, #[account(mut)] @@ -108,7 +108,7 @@ pub struct ProxyTransfer<'info> { pub struct ProxyOptionalTransfer<'info> { #[account(signer)] /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, #[account(mut)] pub from: InterfaceAccount<'info, TokenAccount>, #[account(mut)] @@ -121,7 +121,7 @@ pub struct ProxyOptionalTransfer<'info> { pub struct ProxyMintTo<'info> { #[account(signer)] /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, #[account(mut)] pub mint: InterfaceAccount<'info, Mint>, #[account(mut)] @@ -133,7 +133,7 @@ pub struct ProxyMintTo<'info> { pub struct ProxyBurn<'info> { #[account(signer)] /// CHECK: - pub authority: AccountInfo<'info>, + pub authority: UncheckedAccount<'info>, #[account(mut)] pub mint: InterfaceAccount<'info, Mint>, #[account(mut)] @@ -145,10 +145,10 @@ pub struct ProxyBurn<'info> { pub struct ProxySetAuthority<'info> { #[account(signer)] /// CHECK: - pub current_authority: AccountInfo<'info>, + pub current_authority: UncheckedAccount<'info>, #[account(mut)] /// CHECK: - pub account_or_mint: AccountInfo<'info>, + pub account_or_mint: UncheckedAccount<'info>, pub token_program: Interface<'info, TokenInterface>, } @@ -211,7 +211,7 @@ impl<'a, 'b, 'c, 'info> From<&mut ProxyTransfer<'info>> let cpi_accounts = Transfer { from: accounts.from.to_account_info(), to: accounts.to.to_account_info(), - authority: accounts.authority.clone(), + authority: accounts.authority.to_account_info(), }; let cpi_program_id = accounts.token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -225,7 +225,7 @@ impl<'a, 'b, 'c, 'info> From<&mut ProxyMintTo<'info>> let cpi_accounts = MintTo { mint: accounts.mint.to_account_info(), to: accounts.to.to_account_info(), - authority: accounts.authority.clone(), + authority: accounts.authority.to_account_info(), }; let cpi_program_id = accounts.token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -237,7 +237,7 @@ impl<'a, 'b, 'c, 'info> From<&mut ProxyBurn<'info>> for CpiContext<'a, 'b, 'c, ' let cpi_accounts = Burn { mint: accounts.mint.to_account_info(), from: accounts.from.to_account_info(), - authority: accounts.authority.clone(), + authority: accounts.authority.to_account_info(), }; let cpi_program_id = accounts.token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) @@ -251,8 +251,8 @@ impl<'a, 'b, 'c, 'info> From<&mut ProxySetAuthority<'info>> accounts: &mut ProxySetAuthority<'info>, ) -> CpiContext<'a, 'b, 'c, 'info, SetAuthority<'info>> { let cpi_accounts = SetAuthority { - account_or_mint: accounts.account_or_mint.clone(), - current_authority: accounts.current_authority.clone(), + account_or_mint: accounts.account_or_mint.to_account_info(), + current_authority: accounts.current_authority.to_account_info(), }; // TODO: Support multisig signers let cpi_program_id = accounts.token_program.key(); CpiContext::new(cpi_program_id, cpi_accounts) diff --git a/tests/spl/token-wrapper/programs/token-wrapper/src/lib.rs b/tests/spl/token-wrapper/programs/token-wrapper/src/lib.rs index 9f1886f244..886b0aa2ce 100644 --- a/tests/spl/token-wrapper/programs/token-wrapper/src/lib.rs +++ b/tests/spl/token-wrapper/programs/token-wrapper/src/lib.rs @@ -202,7 +202,7 @@ pub struct Initialize<'info> { seeds = [WRAPPER_AUTH_SEED, deposit_mint.key().as_ref(), wrapped_mint.key().as_ref()], bump, )] - pub wrapper_authority: AccountInfo<'info>, + pub wrapper_authority: UncheckedAccount<'info>, pub system_program: Program<'info, System>, pub deposit_token_program: Interface<'info, TokenInterface>, @@ -253,7 +253,7 @@ pub struct Wrap<'info> { seeds = [WRAPPER_AUTH_SEED, deposit_mint.key().as_ref(), wrapped_mint.key().as_ref()], bump, )] - pub wrapper_authority: AccountInfo<'info>, + pub wrapper_authority: UncheckedAccount<'info>, pub deposit_token_program: Interface<'info, TokenInterface>, pub wrapped_token_program: Interface<'info, TokenInterface>, @@ -303,7 +303,7 @@ pub struct Unwrap<'info> { seeds = [crate::token_wrapper::WRAPPER_AUTH_SEED, deposit_mint.key().as_ref(), wrapped_mint.key().as_ref()], bump, )] - pub wrapper_authority: AccountInfo<'info>, + pub wrapper_authority: UncheckedAccount<'info>, pub deposit_token_program: Interface<'info, TokenInterface>, pub wrapped_token_program: Interface<'info, TokenInterface>, diff --git a/tests/swap/programs/swap/src/lib.rs b/tests/swap/programs/swap/src/lib.rs index 152e2a1639..1f2edd3f29 100644 --- a/tests/swap/programs/swap/src/lib.rs +++ b/tests/swap/programs/swap/src/lib.rs @@ -192,14 +192,14 @@ fn apply_risk_checks(event: DidSwap) -> Result<()> { pub struct Swap<'info> { market: MarketAccounts<'info>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account(mut)] - pc_wallet: AccountInfo<'info>, + pc_wallet: UncheckedAccount<'info>, // Programs. - dex_program: AccountInfo<'info>, - token_program: AccountInfo<'info>, + dex_program: UncheckedAccount<'info>, + token_program: UncheckedAccount<'info>, // Sysvars. - rent: AccountInfo<'info>, + rent: UncheckedAccount<'info>, } impl<'info> From<&Swap<'info>> for OrderbookClient<'info> { @@ -225,14 +225,14 @@ pub struct SwapTransitive<'info> { to: MarketAccounts<'info>, // Must be the authority over all open orders accounts used. #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, #[account(mut)] - pc_wallet: AccountInfo<'info>, + pc_wallet: UncheckedAccount<'info>, // Programs. - dex_program: AccountInfo<'info>, - token_program: AccountInfo<'info>, + dex_program: UncheckedAccount<'info>, + token_program: UncheckedAccount<'info>, // Sysvars. - rent: AccountInfo<'info>, + rent: UncheckedAccount<'info>, } impl<'info> SwapTransitive<'info> { @@ -261,11 +261,11 @@ impl<'info> SwapTransitive<'info> { // Client for sending orders to the Serum DEX. struct OrderbookClient<'info> { market: MarketAccounts<'info>, - authority: AccountInfo<'info>, - pc_wallet: AccountInfo<'info>, - dex_program: AccountInfo<'info>, - token_program: AccountInfo<'info>, - rent: AccountInfo<'info>, + authority: UncheckedAccount<'info>, + pc_wallet: UncheckedAccount<'info>, + dex_program: UncheckedAccount<'info>, + token_program: UncheckedAccount<'info>, + rent: UncheckedAccount<'info>, } impl<'info> OrderbookClient<'info> { @@ -394,36 +394,36 @@ fn coin_lots(market: &MarketState, size: u64) -> u64 { #[derive(Accounts, Clone)] pub struct MarketAccounts<'info> { #[account(mut)] - market: AccountInfo<'info>, + market: UncheckedAccount<'info>, #[account(mut)] - open_orders: AccountInfo<'info>, + open_orders: UncheckedAccount<'info>, #[account(mut)] - request_queue: AccountInfo<'info>, + request_queue: UncheckedAccount<'info>, #[account(mut)] - event_queue: AccountInfo<'info>, + event_queue: UncheckedAccount<'info>, #[account(mut)] - bids: AccountInfo<'info>, + bids: UncheckedAccount<'info>, #[account(mut)] - asks: AccountInfo<'info>, + asks: UncheckedAccount<'info>, // The `spl_token::Account` that funds will be taken from, i.e., transferred // from the user into the market's vault. // // For bids, this is the base currency. For asks, the quote. #[account(mut)] - order_payer_token_account: AccountInfo<'info>, + order_payer_token_account: UncheckedAccount<'info>, // Also known as the "base" currency. For a given A/B market, // this is the vault for the A mint. #[account(mut)] - coin_vault: AccountInfo<'info>, + coin_vault: UncheckedAccount<'info>, // Also known as the "quote" currency. For a given A/B market, // this is the vault for the B mint. #[account(mut)] - pc_vault: AccountInfo<'info>, + pc_vault: UncheckedAccount<'info>, // PDA owner of the DEX's token accounts for base + quote currencies. - vault_signer: AccountInfo<'info>, + vault_signer: UncheckedAccount<'info>, // User wallets. #[account(mut)] - coin_wallet: AccountInfo<'info>, + coin_wallet: UncheckedAccount<'info>, } #[derive(AnchorSerialize, AnchorDeserialize)] diff --git a/tests/zero-copy/programs/zero-copy/src/lib.rs b/tests/zero-copy/programs/zero-copy/src/lib.rs index a71c562e3f..6f4257f391 100644 --- a/tests/zero-copy/programs/zero-copy/src/lib.rs +++ b/tests/zero-copy/programs/zero-copy/src/lib.rs @@ -104,7 +104,7 @@ pub struct CreateBar<'info> { #[account(mut)] authority: Signer<'info>, foo: AccountLoader<'info, Foo>, - system_program: AccountInfo<'info>, + system_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct UpdateBar<'info> { diff --git a/tests/zero-copy/programs/zero-cpi/src/lib.rs b/tests/zero-copy/programs/zero-cpi/src/lib.rs index 496334d1b6..9af7a299f3 100644 --- a/tests/zero-copy/programs/zero-cpi/src/lib.rs +++ b/tests/zero-copy/programs/zero-cpi/src/lib.rs @@ -10,7 +10,7 @@ pub mod zero_cpi { use super::*; pub fn check_cpi(ctx: Context, data: u64) -> Result<()> { let cpi_accounts = UpdateBar { - authority: ctx.accounts.authority.clone(), + authority: ctx.accounts.authority.to_account_info(), bar: ctx.accounts.bar.to_account_info(), foo: ctx.accounts.foo.to_account_info(), }; @@ -28,7 +28,7 @@ pub struct CheckCpi<'info> { )] bar: AccountLoader<'info, Bar>, #[account(signer)] - authority: AccountInfo<'info>, + authority: UncheckedAccount<'info>, foo: AccountLoader<'info, Foo>, zero_copy_program: Program<'info, ZeroCopy>, } diff --git a/ts/packages/spl-associated-token-account/program/lib.rs b/ts/packages/spl-associated-token-account/program/lib.rs index 5bb187f3f1..19206b2e12 100644 --- a/ts/packages/spl-associated-token-account/program/lib.rs +++ b/ts/packages/spl-associated-token-account/program/lib.rs @@ -26,9 +26,9 @@ pub struct Create<'info> { #[account(mut)] funding_address: Signer<'info>, #[account(mut)] - associated_account_address: AccountInfo<'info>, - wallet_address: AccountInfo<'info>, - token_mint_address: AccountInfo<'info>, + associated_account_address: UncheckedAccount<'info>, + wallet_address: UncheckedAccount<'info>, + token_mint_address: UncheckedAccount<'info>, system_program: Program<'info, System>, token_program: Program<'info, Token>, } @@ -38,9 +38,9 @@ pub struct CreateIdempotent<'info> { #[account(mut)] funding_address: Signer<'info>, #[account(mut)] - associated_account_address: AccountInfo<'info>, - wallet_address: AccountInfo<'info>, - token_mint_address: AccountInfo<'info>, + associated_account_address: UncheckedAccount<'info>, + wallet_address: UncheckedAccount<'info>, + token_mint_address: UncheckedAccount<'info>, system_program: Program<'info, System>, token_program: Program<'info, Token>, } @@ -48,12 +48,12 @@ pub struct CreateIdempotent<'info> { #[derive(Accounts)] pub struct RecoverNested<'info> { #[account(mut)] - nested_associated_account_address: AccountInfo<'info>, - nested_token_mint_address: AccountInfo<'info>, + nested_associated_account_address: UncheckedAccount<'info>, + nested_token_mint_address: UncheckedAccount<'info>, #[account(mut)] - destination_associated_account_address: AccountInfo<'info>, - owner_associated_account_address: AccountInfo<'info>, - owner_token_mint_address: AccountInfo<'info>, + destination_associated_account_address: UncheckedAccount<'info>, + owner_associated_account_address: UncheckedAccount<'info>, + owner_token_mint_address: UncheckedAccount<'info>, #[account(mut)] wallet_address: Signer<'info>, token_program: Program<'info, Token>, diff --git a/ts/packages/spl-binary-option/program/lib.rs b/ts/packages/spl-binary-option/program/lib.rs index a66f889ac0..9888ad6de9 100644 --- a/ts/packages/spl-binary-option/program/lib.rs +++ b/ts/packages/spl-binary-option/program/lib.rs @@ -32,7 +32,7 @@ pub mod spl_binary_option { pub struct InitializeBinaryOption<'info> { #[account(mut)] pool_account: Signer<'info>, - escrow_mint: AccountInfo<'info>, + escrow_mint: UncheckedAccount<'info>, #[account(mut)] escrow_account: Signer<'info>, #[account(mut)] @@ -49,58 +49,58 @@ pub struct InitializeBinaryOption<'info> { #[derive(Accounts)] pub struct Trade<'info> { #[account(mut)] - pool_account: AccountInfo<'info>, + pool_account: UncheckedAccount<'info>, #[account(mut)] - escrow_account: AccountInfo<'info>, + escrow_account: UncheckedAccount<'info>, #[account(mut)] - long_token_mint: AccountInfo<'info>, + long_token_mint: UncheckedAccount<'info>, #[account(mut)] - short_token_mint: AccountInfo<'info>, + short_token_mint: UncheckedAccount<'info>, buyer: Signer<'info>, seller: Signer<'info>, #[account(mut)] - buyer_account: AccountInfo<'info>, + buyer_account: UncheckedAccount<'info>, #[account(mut)] - seller_account: AccountInfo<'info>, + seller_account: UncheckedAccount<'info>, #[account(mut)] - buyer_long_token_account: AccountInfo<'info>, + buyer_long_token_account: UncheckedAccount<'info>, #[account(mut)] - buyer_short_token_account: AccountInfo<'info>, + buyer_short_token_account: UncheckedAccount<'info>, #[account(mut)] - seller_long_token_account: AccountInfo<'info>, + seller_long_token_account: UncheckedAccount<'info>, #[account(mut)] - seller_short_token_account: AccountInfo<'info>, - escrow_authority: AccountInfo<'info>, + seller_short_token_account: UncheckedAccount<'info>, + escrow_authority: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct Settle<'info> { #[account(mut)] - pool_account: AccountInfo<'info>, - winning_mint: AccountInfo<'info>, + pool_account: UncheckedAccount<'info>, + winning_mint: UncheckedAccount<'info>, pool_authority: Signer<'info>, } #[derive(Accounts)] pub struct Collect<'info> { #[account(mut)] - pool_account: AccountInfo<'info>, - collector_account: AccountInfo<'info>, + pool_account: UncheckedAccount<'info>, + collector_account: UncheckedAccount<'info>, #[account(mut)] - collector_long_token_account: AccountInfo<'info>, + collector_long_token_account: UncheckedAccount<'info>, #[account(mut)] - collector_short_token_account: AccountInfo<'info>, + collector_short_token_account: UncheckedAccount<'info>, #[account(mut)] - collector_collateral_account: AccountInfo<'info>, + collector_collateral_account: UncheckedAccount<'info>, #[account(mut)] - long_token_mint_account: AccountInfo<'info>, + long_token_mint_account: UncheckedAccount<'info>, #[account(mut)] - short_token_mint_account: AccountInfo<'info>, + short_token_mint_account: UncheckedAccount<'info>, #[account(mut)] - escrow_account: AccountInfo<'info>, + escrow_account: UncheckedAccount<'info>, #[account(mut)] - escrow_authority_account: AccountInfo<'info>, + escrow_authority_account: UncheckedAccount<'info>, token_program: Program<'info, Token>, } diff --git a/ts/packages/spl-binary-oracle-pair/program/lib.rs b/ts/packages/spl-binary-oracle-pair/program/lib.rs index b0a1ef4a43..7b6e16e41d 100644 --- a/ts/packages/spl-binary-oracle-pair/program/lib.rs +++ b/ts/packages/spl-binary-oracle-pair/program/lib.rs @@ -33,58 +33,58 @@ pub mod spl_binary_oracle_pair { #[derive(Accounts)] pub struct InitPool<'info> { #[account(mut)] - pool: AccountInfo<'info>, - authority: AccountInfo<'info>, - decider: AccountInfo<'info>, - deposit_token_mint: AccountInfo<'info>, + pool: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, + decider: UncheckedAccount<'info>, + deposit_token_mint: UncheckedAccount<'info>, #[account(mut)] - deposit_account: AccountInfo<'info>, + deposit_account: UncheckedAccount<'info>, #[account(mut)] - token_pass_mint: AccountInfo<'info>, + token_pass_mint: UncheckedAccount<'info>, #[account(mut)] - token_fail_mint: AccountInfo<'info>, + token_fail_mint: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct Deposit<'info> { - pool: AccountInfo<'info>, - authority: AccountInfo<'info>, + pool: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - user_token_account: AccountInfo<'info>, + user_token_account: UncheckedAccount<'info>, #[account(mut)] - pool_deposit_token_account: AccountInfo<'info>, + pool_deposit_token_account: UncheckedAccount<'info>, #[account(mut)] - token_pass_mint: AccountInfo<'info>, + token_pass_mint: UncheckedAccount<'info>, #[account(mut)] - token_fail_mint: AccountInfo<'info>, + token_fail_mint: UncheckedAccount<'info>, #[account(mut)] - token_pass_destination_account: AccountInfo<'info>, + token_pass_destination_account: UncheckedAccount<'info>, #[account(mut)] - token_fail_destination_account: AccountInfo<'info>, + token_fail_destination_account: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct Withdraw<'info> { - pool: AccountInfo<'info>, - authority: AccountInfo<'info>, + pool: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - pool_deposit_token_account: AccountInfo<'info>, + pool_deposit_token_account: UncheckedAccount<'info>, #[account(mut)] - token_pass_user_account: AccountInfo<'info>, + token_pass_user_account: UncheckedAccount<'info>, #[account(mut)] - token_fail_user_account: AccountInfo<'info>, + token_fail_user_account: UncheckedAccount<'info>, #[account(mut)] - token_pass_mint: AccountInfo<'info>, + token_pass_mint: UncheckedAccount<'info>, #[account(mut)] - token_fail_mint: AccountInfo<'info>, + token_fail_mint: UncheckedAccount<'info>, #[account(mut)] - user_token_destination_account: AccountInfo<'info>, + user_token_destination_account: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, } @@ -92,7 +92,7 @@ pub struct Withdraw<'info> { #[derive(Accounts)] pub struct Decide<'info> { #[account(mut)] - pool: AccountInfo<'info>, + pool: UncheckedAccount<'info>, decider: Signer<'info>, clock: Sysvar<'info, Clock>, } diff --git a/ts/packages/spl-feature-proposal/program/lib.rs b/ts/packages/spl-feature-proposal/program/lib.rs index 60c14709a1..91132a7497 100644 --- a/ts/packages/spl-feature-proposal/program/lib.rs +++ b/ts/packages/spl-feature-proposal/program/lib.rs @@ -28,13 +28,13 @@ pub struct Propose<'info> { #[account(mut)] feature_proposal_address: Signer<'info>, #[account(mut)] - mint_address: AccountInfo<'info>, + mint_address: UncheckedAccount<'info>, #[account(mut)] - distributor_token_address: AccountInfo<'info>, + distributor_token_address: UncheckedAccount<'info>, #[account(mut)] - acceptance_token_address: AccountInfo<'info>, + acceptance_token_address: UncheckedAccount<'info>, #[account(mut)] - feature: AccountInfo<'info>, + feature: UncheckedAccount<'info>, system_program: Program<'info, System>, token_program: Program<'info, Token>, rent: Sysvar<'info, Rent>, @@ -43,10 +43,10 @@ pub struct Propose<'info> { #[derive(Accounts)] pub struct Tally<'info> { #[account(mut)] - feature_proposal_address: AccountInfo<'info>, - acceptance_token_address: AccountInfo<'info>, + feature_proposal_address: UncheckedAccount<'info>, + acceptance_token_address: UncheckedAccount<'info>, #[account(mut)] - feature: AccountInfo<'info>, + feature: UncheckedAccount<'info>, system_program: Program<'info, System>, clock: Sysvar<'info, Clock>, } diff --git a/ts/packages/spl-governance/program/lib.rs b/ts/packages/spl-governance/program/lib.rs index 7ae438cda8..b169e405d5 100644 --- a/ts/packages/spl-governance/program/lib.rs +++ b/ts/packages/spl-governance/program/lib.rs @@ -163,36 +163,36 @@ pub mod spl_governance { #[derive(Accounts)] pub struct CreateRealm<'info> { #[account(mut)] - realm_address: AccountInfo<'info>, - realm_authority: AccountInfo<'info>, - community_token_mint: AccountInfo<'info>, + realm_address: UncheckedAccount<'info>, + realm_authority: UncheckedAccount<'info>, + community_token_mint: UncheckedAccount<'info>, #[account(mut)] - community_token_holding_address: AccountInfo<'info>, + community_token_holding_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, token_program: Program<'info, Token>, rent: Sysvar<'info, Rent>, - // optional_council_token_mint: AccountInfo<'info>, + // optional_council_token_mint: UncheckedAccount<'info>, // #[account(mut)] - // optional_council_token_holding_address: AccountInfo<'info>, + // optional_council_token_holding_address: UncheckedAccount<'info>, // optional_community_voter_weight_addin: Signer<'info>, // optional_max_community_voter_weight_addin: Signer<'info>, // #[account(mut)] - // optional_realm_config_address: AccountInfo<'info>, + // optional_realm_config_address: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DepositGoverningTokens<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governing_token_holding_address: AccountInfo<'info>, + governing_token_holding_address: UncheckedAccount<'info>, #[account(mut)] - governing_token_source: AccountInfo<'info>, + governing_token_source: UncheckedAccount<'info>, governing_token_owner: Signer<'info>, governing_token_transfer_authority: Signer<'info>, #[account(mut)] - token_owner_record_address: AccountInfo<'info>, + token_owner_record_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -201,14 +201,14 @@ pub struct DepositGoverningTokens<'info> { #[derive(Accounts)] pub struct WithdrawGoverningTokens<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governing_token_holding_address: AccountInfo<'info>, + governing_token_holding_address: UncheckedAccount<'info>, #[account(mut)] - governing_token_destination: AccountInfo<'info>, + governing_token_destination: UncheckedAccount<'info>, governing_token_owner: Signer<'info>, #[account(mut)] - token_owner_record_address: AccountInfo<'info>, + token_owner_record_address: UncheckedAccount<'info>, token_program: Program<'info, Token>, } @@ -216,16 +216,16 @@ pub struct WithdrawGoverningTokens<'info> { pub struct SetGovernanceDelegate<'info> { governance_authority: Signer<'info>, #[account(mut)] - vote_record_address: AccountInfo<'info>, + vote_record_address: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct CreateGovernance<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governance_address: AccountInfo<'info>, - governed_account_address: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + governance_address: UncheckedAccount<'info>, + governed_account_address: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -234,31 +234,31 @@ pub struct CreateGovernance<'info> { #[derive(Accounts)] pub struct CreateProgramGovernance<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - program_governance_address: AccountInfo<'info>, - governed_program: AccountInfo<'info>, + program_governance_address: UncheckedAccount<'info>, + governed_program: UncheckedAccount<'info>, #[account(mut)] - governed_program_data_address: AccountInfo<'info>, + governed_program_data_address: UncheckedAccount<'info>, governed_program_upgrade_authority: Signer<'info>, - token_owner_record: AccountInfo<'info>, + token_owner_record: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, - bpf_loader_upgradeable: AccountInfo<'info>, + bpf_loader_upgradeable: UncheckedAccount<'info>, system_program: Program<'info, System>, create_authority: Signer<'info>, } #[derive(Accounts)] pub struct CreateProposal<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - proposal_address: AccountInfo<'info>, + proposal_address: UncheckedAccount<'info>, #[account(mut)] - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal_owner_record: AccountInfo<'info>, - governing_token_mint: AccountInfo<'info>, + proposal_owner_record: UncheckedAccount<'info>, + governing_token_mint: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] payer: Signer<'info>, @@ -268,11 +268,11 @@ pub struct CreateProposal<'info> { #[derive(Accounts)] pub struct AddSignatory<'info> { #[account(mut)] - proposal: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - signatory_record_address: AccountInfo<'info>, + signatory_record_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -281,24 +281,24 @@ pub struct AddSignatory<'info> { #[derive(Accounts)] pub struct RemoveSignatory<'info> { #[account(mut)] - proposal: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - signatory_record_address: AccountInfo<'info>, + signatory_record_address: UncheckedAccount<'info>, #[account(mut)] - beneficiary: AccountInfo<'info>, + beneficiary: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InsertTransaction<'info> { - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - proposal_transaction_address: AccountInfo<'info>, + proposal_transaction_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -308,58 +308,58 @@ pub struct InsertTransaction<'info> { #[derive(Accounts)] pub struct RemoveTransaction<'info> { #[account(mut)] - proposal: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - proposal_transaction: AccountInfo<'info>, + proposal_transaction: UncheckedAccount<'info>, #[account(mut)] - beneficiary: AccountInfo<'info>, + beneficiary: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct CancelProposal<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, #[account(mut)] - proposal_owner_record: AccountInfo<'info>, + proposal_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, } #[derive(Accounts)] pub struct SignOffProposal<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, signatory: Signer<'info>, - // optional_proposal_owner_record: AccountInfo<'info>, + // optional_proposal_owner_record: UncheckedAccount<'info>, // #[account(mut)] - // optional_signatory_record_address: AccountInfo<'info>, + // optional_signatory_record_address: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct CastVote<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, #[account(mut)] - proposal_owner_record: AccountInfo<'info>, + proposal_owner_record: UncheckedAccount<'info>, #[account(mut)] - voter_token_owner_record: AccountInfo<'info>, + voter_token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - vote_record_address: AccountInfo<'info>, - vote_governing_token_mint: AccountInfo<'info>, + vote_record_address: UncheckedAccount<'info>, + vote_governing_token_mint: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -368,51 +368,51 @@ pub struct CastVote<'info> { #[derive(Accounts)] pub struct FinalizeVote<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, #[account(mut)] - proposal_owner_record: AccountInfo<'info>, - governing_token_mint: AccountInfo<'info>, + proposal_owner_record: UncheckedAccount<'info>, + governing_token_mint: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct RelinquishVote<'info> { - realm: AccountInfo<'info>, - governance: AccountInfo<'info>, + realm: UncheckedAccount<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, #[account(mut)] - token_owner_record: AccountInfo<'info>, + token_owner_record: UncheckedAccount<'info>, #[account(mut)] - vote_record_address: AccountInfo<'info>, - vote_governing_token_mint: AccountInfo<'info>, + vote_record_address: UncheckedAccount<'info>, + vote_governing_token_mint: UncheckedAccount<'info>, // optional_governance_authority: Signer<'info>, // #[account(mut)] - // optional_beneficiary: AccountInfo<'info>, + // optional_beneficiary: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct ExecuteTransaction<'info> { - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - proposal: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, #[account(mut)] - proposal_transaction: AccountInfo<'info>, - instruction_program: AccountInfo<'info>, + proposal_transaction: UncheckedAccount<'info>, + instruction_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct CreateMintGovernance<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - mint_governance_address: AccountInfo<'info>, + mint_governance_address: UncheckedAccount<'info>, #[account(mut)] - governed_mint: AccountInfo<'info>, + governed_mint: UncheckedAccount<'info>, governed_mint_authority: Signer<'info>, - token_owner_record: AccountInfo<'info>, + token_owner_record: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, token_program: Program<'info, Token>, @@ -422,13 +422,13 @@ pub struct CreateMintGovernance<'info> { #[derive(Accounts)] pub struct CreateTokenGovernance<'info> { - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, #[account(mut)] - token_governance_address: AccountInfo<'info>, + token_governance_address: UncheckedAccount<'info>, #[account(mut)] - governed_token: AccountInfo<'info>, + governed_token: UncheckedAccount<'info>, governed_token_owner: Signer<'info>, - token_owner_record: AccountInfo<'info>, + token_owner_record: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, token_program: Program<'info, Token>, @@ -445,17 +445,17 @@ pub struct SetGovernanceConfig<'info> { #[derive(Accounts)] pub struct FlagTransactionError<'info> { #[account(mut)] - proposal: AccountInfo<'info>, - token_owner_record: AccountInfo<'info>, + proposal: UncheckedAccount<'info>, + token_owner_record: UncheckedAccount<'info>, governance_authority: Signer<'info>, #[account(mut)] - proposal_transaction: AccountInfo<'info>, + proposal_transaction: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct SetRealmAuthority<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, realm_authority: Signer<'info>, // optional_new_realm_authority: Signer<'info>, } @@ -463,14 +463,14 @@ pub struct SetRealmAuthority<'info> { #[derive(Accounts)] pub struct SetRealmConfig<'info> { #[account(mut)] - realm: AccountInfo<'info>, + realm: UncheckedAccount<'info>, realm_authority: Signer<'info>, - // optional_council_token_mint: AccountInfo<'info>, + // optional_council_token_mint: UncheckedAccount<'info>, // #[account(mut)] - // optional_council_token_holding_address: AccountInfo<'info>, + // optional_council_token_holding_address: UncheckedAccount<'info>, // optional_system_program: Program<'info, System>, // #[account(mut)] - // optional_realm_config_address: AccountInfo<'info>, + // optional_realm_config_address: UncheckedAccount<'info>, // optional_community_voter_weight_addin: Signer<'info>, // optional_max_community_voter_weight_addin: Signer<'info>, // #[account(mut)] @@ -479,11 +479,11 @@ pub struct SetRealmConfig<'info> { #[derive(Accounts)] pub struct CreateTokenOwnerRecord<'info> { - realm: AccountInfo<'info>, - governing_token_owner: AccountInfo<'info>, + realm: UncheckedAccount<'info>, + governing_token_owner: UncheckedAccount<'info>, #[account(mut)] - token_owner_record_address: AccountInfo<'info>, - governing_token_mint: AccountInfo<'info>, + token_owner_record_address: UncheckedAccount<'info>, + governing_token_mint: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -492,7 +492,7 @@ pub struct CreateTokenOwnerRecord<'info> { #[derive(Accounts)] pub struct UpdateProgramMetadata<'info> { #[account(mut)] - program_metadata_address: AccountInfo<'info>, + program_metadata_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, @@ -500,9 +500,9 @@ pub struct UpdateProgramMetadata<'info> { #[derive(Accounts)] pub struct CreateNativeTreasury<'info> { - governance: AccountInfo<'info>, + governance: UncheckedAccount<'info>, #[account(mut)] - native_treasury_address: AccountInfo<'info>, + native_treasury_address: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, system_program: Program<'info, System>, diff --git a/ts/packages/spl-name-service/program/lib.rs b/ts/packages/spl-name-service/program/lib.rs index 7b10b229fa..ee8929e8cc 100644 --- a/ts/packages/spl-name-service/program/lib.rs +++ b/ts/packages/spl-name-service/program/lib.rs @@ -36,28 +36,28 @@ pub struct Create<'info> { #[account(mut)] payer: Signer<'info>, #[account(mut)] - name_account: AccountInfo<'info>, - name_owner: AccountInfo<'info>, + name_account: UncheckedAccount<'info>, + name_owner: UncheckedAccount<'info>, // optional_name_class: Signer<'info>, - // optional_Pubkey: AccountInfo<'info>, - // optional_name_parent: AccountInfo<'info>, - // optional_Pubkey: AccountInfo<'info>, + // optional_Pubkey: UncheckedAccount<'info>, + // optional_name_parent: UncheckedAccount<'info>, + // optional_Pubkey: UncheckedAccount<'info>, // optional_key: Signer<'info>, } #[derive(Accounts)] pub struct Update<'info> { #[account(mut)] - name_account: AccountInfo<'info>, + name_account: UncheckedAccount<'info>, name_update_signer: Signer<'info>, // #[account(mut)] - // optional_name_parent: AccountInfo<'info>, + // optional_name_parent: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct Transfer<'info> { #[account(mut)] - name_account: AccountInfo<'info>, + name_account: UncheckedAccount<'info>, name_owner: Signer<'info>, // optional_key: Signer<'info>, } @@ -65,10 +65,10 @@ pub struct Transfer<'info> { #[derive(Accounts)] pub struct Delete<'info> { #[account(mut)] - name_account: AccountInfo<'info>, + name_account: UncheckedAccount<'info>, name_owner: Signer<'info>, #[account(mut)] - refund_target: AccountInfo<'info>, + refund_target: UncheckedAccount<'info>, } #[account] diff --git a/ts/packages/spl-record/program/lib.rs b/ts/packages/spl-record/program/lib.rs index 5551d20d6a..21b6a85a0d 100644 --- a/ts/packages/spl-record/program/lib.rs +++ b/ts/packages/spl-record/program/lib.rs @@ -28,32 +28,32 @@ pub mod spl_record { #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] - record_account: AccountInfo<'info>, - authority: AccountInfo<'info>, + record_account: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct Write<'info> { #[account(mut)] - record_account: AccountInfo<'info>, + record_account: UncheckedAccount<'info>, signer: Signer<'info>, } #[derive(Accounts)] pub struct SetAuthority<'info> { #[account(mut)] - record_account: AccountInfo<'info>, + record_account: UncheckedAccount<'info>, signer: Signer<'info>, - new_authority: AccountInfo<'info>, + new_authority: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct CloseAccount<'info> { #[account(mut)] - record_account: AccountInfo<'info>, + record_account: UncheckedAccount<'info>, signer: Signer<'info>, #[account(mut)] - receiver: AccountInfo<'info>, + receiver: UncheckedAccount<'info>, } #[account] diff --git a/ts/packages/spl-stake-pool/program/lib.rs b/ts/packages/spl-stake-pool/program/lib.rs index 00907aff57..c47a29017a 100644 --- a/ts/packages/spl-stake-pool/program/lib.rs +++ b/ts/packages/spl-stake-pool/program/lib.rs @@ -126,17 +126,17 @@ pub mod spl_stake_pool { #[derive(Accounts)] pub struct Initialize<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, - staker: AccountInfo<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + staker: UncheckedAccount<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list: AccountInfo<'info>, - reserve_stake: AccountInfo<'info>, + validator_list: UncheckedAccount<'info>, + reserve_stake: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - manager_pool_account: AccountInfo<'info>, + manager_pool_account: UncheckedAccount<'info>, token_program: Program<'info, Token>, // optional_deposit_authority: Signer<'info>, } @@ -144,220 +144,220 @@ pub struct Initialize<'info> { #[derive(Accounts)] pub struct AddValidatorToPool<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, staker: Signer<'info>, #[account(mut)] funder: Signer<'info>, - stake_pool_withdraw: AccountInfo<'info>, + stake_pool_withdraw: UncheckedAccount<'info>, #[account(mut)] - validator_list: AccountInfo<'info>, + validator_list: UncheckedAccount<'info>, #[account(mut)] - stake: AccountInfo<'info>, - validator: AccountInfo<'info>, + stake: UncheckedAccount<'info>, + validator: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, clock: Sysvar<'info, Clock>, - sysvar_stake_history: AccountInfo<'info>, - stake_config: AccountInfo<'info>, + sysvar_stake_history: UncheckedAccount<'info>, + stake_config: UncheckedAccount<'info>, system_program: Program<'info, System>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct RemoveValidatorFromPool<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, staker: Signer<'info>, - stake_pool_withdraw: AccountInfo<'info>, - new_stake_authority: AccountInfo<'info>, + stake_pool_withdraw: UncheckedAccount<'info>, + new_stake_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list: AccountInfo<'info>, + validator_list: UncheckedAccount<'info>, #[account(mut)] - stake_account: AccountInfo<'info>, - transient_stake_account: AccountInfo<'info>, + stake_account: UncheckedAccount<'info>, + transient_stake_account: UncheckedAccount<'info>, #[account(mut)] - destination_stake_account: AccountInfo<'info>, + destination_stake_account: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DecreaseValidatorStake<'info> { - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, staker: Signer<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list: AccountInfo<'info>, + validator_list: UncheckedAccount<'info>, #[account(mut)] - validator_stake: AccountInfo<'info>, + validator_stake: UncheckedAccount<'info>, #[account(mut)] - transient_stake: AccountInfo<'info>, + transient_stake: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, rent: Sysvar<'info, Rent>, system_program: Program<'info, System>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct IncreaseValidatorStake<'info> { - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, staker: Signer<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list: AccountInfo<'info>, + validator_list: UncheckedAccount<'info>, #[account(mut)] - reserve_stake: AccountInfo<'info>, + reserve_stake: UncheckedAccount<'info>, #[account(mut)] - transient_stake: AccountInfo<'info>, - validator_stake: AccountInfo<'info>, - validator: AccountInfo<'info>, + transient_stake: UncheckedAccount<'info>, + validator_stake: UncheckedAccount<'info>, + validator: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, rent: Sysvar<'info, Rent>, - sysvar_stake_history: AccountInfo<'info>, - stake_config: AccountInfo<'info>, + sysvar_stake_history: UncheckedAccount<'info>, + stake_config: UncheckedAccount<'info>, system_program: Program<'info, System>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct SetPreferredValidator<'info> { #[account(mut)] - stake_pool_address: AccountInfo<'info>, + stake_pool_address: UncheckedAccount<'info>, staker: Signer<'info>, - validator_list_address: AccountInfo<'info>, + validator_list_address: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct UpdateValidatorListBalance<'info> { - stake_pool: AccountInfo<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list_address: AccountInfo<'info>, + validator_list_address: UncheckedAccount<'info>, #[account(mut)] - reserve_stake: AccountInfo<'info>, + reserve_stake: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, - sysvar_stake_history: AccountInfo<'info>, - stake_program: AccountInfo<'info>, + sysvar_stake_history: UncheckedAccount<'info>, + stake_program: UncheckedAccount<'info>, // #[account(mut)] - // optional_validator_stake_account: AccountInfo<'info>, + // optional_validator_stake_account: UncheckedAccount<'info>, // #[account(mut)] - // optional_transient_stake_account: AccountInfo<'info>, + // optional_transient_stake_account: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct UpdateStakePoolBalance<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, - withdraw_authority: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, + withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - validator_list_storage: AccountInfo<'info>, - reserve_stake: AccountInfo<'info>, + validator_list_storage: UncheckedAccount<'info>, + reserve_stake: UncheckedAccount<'info>, #[account(mut)] - manager_fee_account: AccountInfo<'info>, + manager_fee_account: UncheckedAccount<'info>, #[account(mut)] - stake_pool_mint: AccountInfo<'info>, + stake_pool_mint: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct CleanupRemovedValidatorEntries<'info> { - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, #[account(mut)] - validator_list_storage: AccountInfo<'info>, + validator_list_storage: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DepositStake<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, #[account(mut)] - validator_list_storage: AccountInfo<'info>, - stake_pool_deposit_authority: AccountInfo<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + validator_list_storage: UncheckedAccount<'info>, + stake_pool_deposit_authority: UncheckedAccount<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - deposit_stake_address: AccountInfo<'info>, + deposit_stake_address: UncheckedAccount<'info>, #[account(mut)] - validator_stake_account: AccountInfo<'info>, + validator_stake_account: UncheckedAccount<'info>, #[account(mut)] - reserve_stake_account: AccountInfo<'info>, + reserve_stake_account: UncheckedAccount<'info>, #[account(mut)] - pool_tokens_to: AccountInfo<'info>, + pool_tokens_to: UncheckedAccount<'info>, #[account(mut)] - manager_fee_account: AccountInfo<'info>, + manager_fee_account: UncheckedAccount<'info>, #[account(mut)] - referrer_pool_tokens_account: AccountInfo<'info>, + referrer_pool_tokens_account: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, - sysvar_stake_history: AccountInfo<'info>, + sysvar_stake_history: UncheckedAccount<'info>, token_program: Program<'info, Token>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct WithdrawStake<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, #[account(mut)] - validator_list_storage: AccountInfo<'info>, - stake_pool_withdraw: AccountInfo<'info>, + validator_list_storage: UncheckedAccount<'info>, + stake_pool_withdraw: UncheckedAccount<'info>, #[account(mut)] - stake_to_split: AccountInfo<'info>, + stake_to_split: UncheckedAccount<'info>, #[account(mut)] - stake_to_receive: AccountInfo<'info>, - user_stake_authority: AccountInfo<'info>, + stake_to_receive: UncheckedAccount<'info>, + user_stake_authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - user_pool_token_account: AccountInfo<'info>, + user_pool_token_account: UncheckedAccount<'info>, #[account(mut)] - manager_fee_account: AccountInfo<'info>, + manager_fee_account: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, - stake_program: AccountInfo<'info>, + stake_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct SetManager<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, new_manager: Signer<'info>, - new_fee_receiver: AccountInfo<'info>, + new_fee_receiver: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct SetFee<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, } #[derive(Accounts)] pub struct SetStaker<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, set_staker_authority: Signer<'info>, - new_staker: AccountInfo<'info>, + new_staker: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DepositSol<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - reserve_stake_account: AccountInfo<'info>, + reserve_stake_account: UncheckedAccount<'info>, #[account(mut)] lamports_from: Signer<'info>, #[account(mut)] - pool_tokens_to: AccountInfo<'info>, + pool_tokens_to: UncheckedAccount<'info>, #[account(mut)] - manager_fee_account: AccountInfo<'info>, + manager_fee_account: UncheckedAccount<'info>, #[account(mut)] - referrer_pool_tokens_account: AccountInfo<'info>, + referrer_pool_tokens_account: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, system_program: Program<'info, System>, token_program: Program<'info, Token>, } @@ -365,56 +365,56 @@ pub struct DepositSol<'info> { #[derive(Accounts)] pub struct SetFundingAuthority<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, - // optional_auth: AccountInfo<'info>, + // optional_auth: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct WithdrawSol<'info> { #[account(mut)] - stake_pool: AccountInfo<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - pool_tokens_from: AccountInfo<'info>, + pool_tokens_from: UncheckedAccount<'info>, #[account(mut)] - reserve_stake_account: AccountInfo<'info>, + reserve_stake_account: UncheckedAccount<'info>, #[account(mut)] - lamports_to: AccountInfo<'info>, + lamports_to: UncheckedAccount<'info>, #[account(mut)] - manager_fee_account: AccountInfo<'info>, + manager_fee_account: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, - sysvar_stake_history: AccountInfo<'info>, - stake_program: AccountInfo<'info>, + sysvar_stake_history: UncheckedAccount<'info>, + stake_program: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct CreateTokenMetadata<'info> { - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, - pool_mint: AccountInfo<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] payer: Signer<'info>, #[account(mut)] - token_metadata: AccountInfo<'info>, - mpl_token_metadata: AccountInfo<'info>, + token_metadata: UncheckedAccount<'info>, + mpl_token_metadata: UncheckedAccount<'info>, system_program: Program<'info, System>, rent: Sysvar<'info, Rent>, } #[derive(Accounts)] pub struct UpdateTokenMetadata<'info> { - stake_pool: AccountInfo<'info>, + stake_pool: UncheckedAccount<'info>, manager: Signer<'info>, - stake_pool_withdraw_authority: AccountInfo<'info>, + stake_pool_withdraw_authority: UncheckedAccount<'info>, #[account(mut)] - token_metadata: AccountInfo<'info>, - mpl_token_metadata: AccountInfo<'info>, + token_metadata: UncheckedAccount<'info>, + mpl_token_metadata: UncheckedAccount<'info>, } #[account] diff --git a/ts/packages/spl-stateless-asks/program/lib.rs b/ts/packages/spl-stateless-asks/program/lib.rs index 5f40bf245c..b0505f96bb 100644 --- a/ts/packages/spl-stateless-asks/program/lib.rs +++ b/ts/packages/spl-stateless-asks/program/lib.rs @@ -21,19 +21,19 @@ pub mod spl_stateless_asks { #[derive(Accounts)] pub struct AcceptOffer<'info> { - maker_wallet: AccountInfo<'info>, + maker_wallet: UncheckedAccount<'info>, taker_wallet: Signer<'info>, #[account(mut)] - maker_src_account: AccountInfo<'info>, + maker_src_account: UncheckedAccount<'info>, #[account(mut)] - maker_dst_account: AccountInfo<'info>, + maker_dst_account: UncheckedAccount<'info>, #[account(mut)] - taker_src_account: AccountInfo<'info>, + taker_src_account: UncheckedAccount<'info>, #[account(mut)] - taker_dst_account: AccountInfo<'info>, - maker_mint: AccountInfo<'info>, - taker_mint: AccountInfo<'info>, - authority: AccountInfo<'info>, + taker_dst_account: UncheckedAccount<'info>, + maker_mint: UncheckedAccount<'info>, + taker_mint: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, token_program: Program<'info, Token>, // optional_system_program: Program<'info, System>, } diff --git a/ts/packages/spl-token-lending/program/lib.rs b/ts/packages/spl-token-lending/program/lib.rs index e6bf9d0f70..6973ab986b 100644 --- a/ts/packages/spl-token-lending/program/lib.rs +++ b/ts/packages/spl-token-lending/program/lib.rs @@ -100,40 +100,40 @@ pub mod spl_token_lending { #[derive(Accounts)] pub struct InitLendingMarket<'info> { #[account(mut)] - lending_market: AccountInfo<'info>, + lending_market: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, token_program: Program<'info, Token>, - oracle_program: AccountInfo<'info>, + oracle_program: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct SetLendingMarketOwner<'info> { #[account(mut)] - lending_market: AccountInfo<'info>, + lending_market: UncheckedAccount<'info>, lending_market_owner: Signer<'info>, } #[derive(Accounts)] pub struct InitReserve<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_collateral: AccountInfo<'info>, + destination_collateral: UncheckedAccount<'info>, #[account(mut)] - reserve: AccountInfo<'info>, - reserve_liquidity_mint: AccountInfo<'info>, + reserve: UncheckedAccount<'info>, + reserve_liquidity_mint: UncheckedAccount<'info>, #[account(mut)] - reserve_liquidity_supply: AccountInfo<'info>, + reserve_liquidity_supply: UncheckedAccount<'info>, #[account(mut)] - reserve_liquidity_fee_receiver: AccountInfo<'info>, + reserve_liquidity_fee_receiver: UncheckedAccount<'info>, #[account(mut)] - reserve_collateral_mint: AccountInfo<'info>, + reserve_collateral_mint: UncheckedAccount<'info>, #[account(mut)] - reserve_collateral_supply: AccountInfo<'info>, - pyth_product: AccountInfo<'info>, - pyth_price: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + reserve_collateral_supply: UncheckedAccount<'info>, + pyth_product: UncheckedAccount<'info>, + pyth_price: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, lending_market_owner: Signer<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, @@ -144,25 +144,25 @@ pub struct InitReserve<'info> { #[derive(Accounts)] pub struct RefreshReserve<'info> { #[account(mut)] - reserve: AccountInfo<'info>, - reserve_liquidity_oracle: AccountInfo<'info>, + reserve: UncheckedAccount<'info>, + reserve_liquidity_oracle: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, } #[derive(Accounts)] pub struct DepositReserveLiquidity<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_collateral: AccountInfo<'info>, + destination_collateral: UncheckedAccount<'info>, #[account(mut)] - reserve: AccountInfo<'info>, + reserve: UncheckedAccount<'info>, #[account(mut)] - reserve_liquidity_supply: AccountInfo<'info>, + reserve_liquidity_supply: UncheckedAccount<'info>, #[account(mut)] - reserve_collateral_mint: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + reserve_collateral_mint: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, @@ -171,17 +171,17 @@ pub struct DepositReserveLiquidity<'info> { #[derive(Accounts)] pub struct RedeemReserveCollateral<'info> { #[account(mut)] - source_collateral: AccountInfo<'info>, + source_collateral: UncheckedAccount<'info>, #[account(mut)] - destination_liquidity: AccountInfo<'info>, + destination_liquidity: UncheckedAccount<'info>, #[account(mut)] - reserve: AccountInfo<'info>, + reserve: UncheckedAccount<'info>, #[account(mut)] - reserve_collateral_mint: AccountInfo<'info>, + reserve_collateral_mint: UncheckedAccount<'info>, #[account(mut)] - reserve_liquidity_supply: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + reserve_liquidity_supply: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, @@ -190,8 +190,8 @@ pub struct RedeemReserveCollateral<'info> { #[derive(Accounts)] pub struct InitObligation<'info> { #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, obligation_owner: Signer<'info>, clock: Sysvar<'info, Clock>, rent: Sysvar<'info, Rent>, @@ -201,21 +201,21 @@ pub struct InitObligation<'info> { #[derive(Accounts)] pub struct RefreshObligation<'info> { #[account(mut)] - obligation: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, clock: Sysvar<'info, Clock>, - // optional_pubkey: AccountInfo<'info>, + // optional_pubkey: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DepositObligationCollateral<'info> { #[account(mut)] - source_collateral: AccountInfo<'info>, + source_collateral: UncheckedAccount<'info>, #[account(mut)] - destination_collateral: AccountInfo<'info>, - deposit_reserve: AccountInfo<'info>, + destination_collateral: UncheckedAccount<'info>, + deposit_reserve: UncheckedAccount<'info>, #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, obligation_owner: Signer<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, @@ -225,14 +225,14 @@ pub struct DepositObligationCollateral<'info> { #[derive(Accounts)] pub struct WithdrawObligationCollateral<'info> { #[account(mut)] - source_collateral: AccountInfo<'info>, + source_collateral: UncheckedAccount<'info>, #[account(mut)] - destination_collateral: AccountInfo<'info>, - withdraw_reserve: AccountInfo<'info>, + destination_collateral: UncheckedAccount<'info>, + withdraw_reserve: UncheckedAccount<'info>, #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, obligation_owner: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, @@ -241,35 +241,35 @@ pub struct WithdrawObligationCollateral<'info> { #[derive(Accounts)] pub struct BorrowObligationLiquidity<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_liquidity: AccountInfo<'info>, + destination_liquidity: UncheckedAccount<'info>, #[account(mut)] - borrow_reserve: AccountInfo<'info>, + borrow_reserve: UncheckedAccount<'info>, #[account(mut)] - borrow_reserve_liquidity_fee_receiver: AccountInfo<'info>, + borrow_reserve_liquidity_fee_receiver: UncheckedAccount<'info>, #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, obligation_owner: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, // #[account(mut)] - // optional_host_fee_receiver: AccountInfo<'info>, + // optional_host_fee_receiver: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct RepayObligationLiquidity<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_liquidity: AccountInfo<'info>, + destination_liquidity: UncheckedAccount<'info>, #[account(mut)] - repay_reserve: AccountInfo<'info>, + repay_reserve: UncheckedAccount<'info>, #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, @@ -278,20 +278,20 @@ pub struct RepayObligationLiquidity<'info> { #[derive(Accounts)] pub struct LiquidateObligation<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_collateral: AccountInfo<'info>, + destination_collateral: UncheckedAccount<'info>, #[account(mut)] - repay_reserve: AccountInfo<'info>, + repay_reserve: UncheckedAccount<'info>, #[account(mut)] - repay_reserve_liquidity_supply: AccountInfo<'info>, - withdraw_reserve: AccountInfo<'info>, + repay_reserve_liquidity_supply: UncheckedAccount<'info>, + withdraw_reserve: UncheckedAccount<'info>, #[account(mut)] - withdraw_reserve_collateral_supply: AccountInfo<'info>, + withdraw_reserve_collateral_supply: UncheckedAccount<'info>, #[account(mut)] - obligation: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + obligation: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, clock: Sysvar<'info, Clock>, token_program: Program<'info, Token>, @@ -300,19 +300,19 @@ pub struct LiquidateObligation<'info> { #[derive(Accounts)] pub struct FlashLoan<'info> { #[account(mut)] - source_liquidity: AccountInfo<'info>, + source_liquidity: UncheckedAccount<'info>, #[account(mut)] - destination_liquidity: AccountInfo<'info>, + destination_liquidity: UncheckedAccount<'info>, #[account(mut)] - reserve: AccountInfo<'info>, + reserve: UncheckedAccount<'info>, #[account(mut)] - reserve_liquidity_fee_receiver: AccountInfo<'info>, + reserve_liquidity_fee_receiver: UncheckedAccount<'info>, #[account(mut)] - host_fee_receiver: AccountInfo<'info>, - lending_market: AccountInfo<'info>, - lending_market_authority: AccountInfo<'info>, + host_fee_receiver: UncheckedAccount<'info>, + lending_market: UncheckedAccount<'info>, + lending_market_authority: UncheckedAccount<'info>, token_program: Program<'info, Token>, - flash_loan_receiver_program: AccountInfo<'info>, + flash_loan_receiver_program: UncheckedAccount<'info>, } #[account] diff --git a/ts/packages/spl-token-swap/program/lib.rs b/ts/packages/spl-token-swap/program/lib.rs index ad7d31b9d5..fd0dd35165 100644 --- a/ts/packages/spl-token-swap/program/lib.rs +++ b/ts/packages/spl-token-swap/program/lib.rs @@ -55,116 +55,116 @@ pub mod spl_token_swap { pub struct Initialize<'info> { #[account(mut)] swap: Signer<'info>, - authority: AccountInfo<'info>, - token_a: AccountInfo<'info>, - token_b: AccountInfo<'info>, + authority: UncheckedAccount<'info>, + token_a: UncheckedAccount<'info>, + token_b: UncheckedAccount<'info>, #[account(mut)] - pool: AccountInfo<'info>, - fee: AccountInfo<'info>, + pool: UncheckedAccount<'info>, + fee: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct Swap<'info> { - swap: AccountInfo<'info>, - authority: AccountInfo<'info>, + swap: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - source: AccountInfo<'info>, + source: UncheckedAccount<'info>, #[account(mut)] - swap_source: AccountInfo<'info>, + swap_source: UncheckedAccount<'info>, #[account(mut)] - swap_destination: AccountInfo<'info>, + swap_destination: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - pool_fee: AccountInfo<'info>, + pool_fee: UncheckedAccount<'info>, token_program: Program<'info, Token>, // #[account(mut)] - // optional_host_fee: AccountInfo<'info>, + // optional_host_fee: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct DepositAllTokenTypes<'info> { - swap: AccountInfo<'info>, - authority: AccountInfo<'info>, + swap: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - deposit_token_a: AccountInfo<'info>, + deposit_token_a: UncheckedAccount<'info>, #[account(mut)] - deposit_token_b: AccountInfo<'info>, + deposit_token_b: UncheckedAccount<'info>, #[account(mut)] - swap_token_a: AccountInfo<'info>, + swap_token_a: UncheckedAccount<'info>, #[account(mut)] - swap_token_b: AccountInfo<'info>, + swap_token_b: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct WithdrawAllTokenTypes<'info> { - swap: AccountInfo<'info>, - authority: AccountInfo<'info>, + swap: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - source: AccountInfo<'info>, + source: UncheckedAccount<'info>, #[account(mut)] - swap_token_a: AccountInfo<'info>, + swap_token_a: UncheckedAccount<'info>, #[account(mut)] - swap_token_b: AccountInfo<'info>, + swap_token_b: UncheckedAccount<'info>, #[account(mut)] - destination_token_a: AccountInfo<'info>, + destination_token_a: UncheckedAccount<'info>, #[account(mut)] - destination_token_b: AccountInfo<'info>, + destination_token_b: UncheckedAccount<'info>, #[account(mut)] - fee_account: AccountInfo<'info>, + fee_account: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct DepositSingleTokenTypeExactAmountIn<'info> { - swap: AccountInfo<'info>, - authority: AccountInfo<'info>, + swap: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - source_token: AccountInfo<'info>, + source_token: UncheckedAccount<'info>, #[account(mut)] - swap_token_a: AccountInfo<'info>, + swap_token_a: UncheckedAccount<'info>, #[account(mut)] - swap_token_b: AccountInfo<'info>, + swap_token_b: UncheckedAccount<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, token_program: Program<'info, Token>, } #[derive(Accounts)] pub struct WithdrawSingleTokenTypeExactAmountOut<'info> { - swap: AccountInfo<'info>, - authority: AccountInfo<'info>, + swap: UncheckedAccount<'info>, + authority: UncheckedAccount<'info>, user_transfer_authority: Signer<'info>, #[account(mut)] - pool_mint: AccountInfo<'info>, + pool_mint: UncheckedAccount<'info>, #[account(mut)] - pool_token_source: AccountInfo<'info>, + pool_token_source: UncheckedAccount<'info>, #[account(mut)] - swap_token_a: AccountInfo<'info>, + swap_token_a: UncheckedAccount<'info>, #[account(mut)] - swap_token_b: AccountInfo<'info>, + swap_token_b: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, #[account(mut)] - fee_account: AccountInfo<'info>, + fee_account: UncheckedAccount<'info>, token_program: Program<'info, Token>, } diff --git a/ts/packages/spl-token/program/lib.rs b/ts/packages/spl-token/program/lib.rs index 39d88ba113..2ba9397ba7 100644 --- a/ts/packages/spl-token/program/lib.rs +++ b/ts/packages/spl-token/program/lib.rs @@ -130,33 +130,33 @@ pub mod spl_token { #[derive(Accounts)] pub struct InitializeMint<'info> { #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, } #[derive(Accounts)] pub struct InitializeAccount<'info> { #[account(mut)] - account: AccountInfo<'info>, - mint: AccountInfo<'info>, - owner: AccountInfo<'info>, + account: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, + owner: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, } #[derive(Accounts)] pub struct InitializeMultisig<'info> { #[account(mut)] - multisig: AccountInfo<'info>, + multisig: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, - // optional_signer: AccountInfo<'info>, + // optional_signer: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct Transfer<'info> { #[account(mut)] - source: AccountInfo<'info>, + source: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, authority: Signer<'info>, // optional_signer: Signer<'info>, } @@ -164,8 +164,8 @@ pub struct Transfer<'info> { #[derive(Accounts)] pub struct Approve<'info> { #[account(mut)] - source: AccountInfo<'info>, - delegate: AccountInfo<'info>, + source: UncheckedAccount<'info>, + delegate: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -173,7 +173,7 @@ pub struct Approve<'info> { #[derive(Accounts)] pub struct Revoke<'info> { #[account(mut)] - source: AccountInfo<'info>, + source: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -181,7 +181,7 @@ pub struct Revoke<'info> { #[derive(Accounts)] pub struct SetAuthority<'info> { #[account(mut)] - owned: AccountInfo<'info>, + owned: UncheckedAccount<'info>, owner: Signer<'info>, signer: Signer<'info>, } @@ -189,9 +189,9 @@ pub struct SetAuthority<'info> { #[derive(Accounts)] pub struct MintTo<'info> { #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -199,9 +199,9 @@ pub struct MintTo<'info> { #[derive(Accounts)] pub struct Burn<'info> { #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, authority: Signer<'info>, // optional_signer: Signer<'info>, } @@ -209,9 +209,9 @@ pub struct Burn<'info> { #[derive(Accounts)] pub struct CloseAccount<'info> { #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -219,8 +219,8 @@ pub struct CloseAccount<'info> { #[derive(Accounts)] pub struct FreezeAccount<'info> { #[account(mut)] - account: AccountInfo<'info>, - mint: AccountInfo<'info>, + account: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -228,8 +228,8 @@ pub struct FreezeAccount<'info> { #[derive(Accounts)] pub struct ThawAccount<'info> { #[account(mut)] - account: AccountInfo<'info>, - mint: AccountInfo<'info>, + account: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -237,10 +237,10 @@ pub struct ThawAccount<'info> { #[derive(Accounts)] pub struct TransferChecked<'info> { #[account(mut)] - source: AccountInfo<'info>, - mint: AccountInfo<'info>, + source: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, #[account(mut)] - destination: AccountInfo<'info>, + destination: UncheckedAccount<'info>, authority: Signer<'info>, // optional_signer: Signer<'info>, } @@ -248,9 +248,9 @@ pub struct TransferChecked<'info> { #[derive(Accounts)] pub struct ApproveChecked<'info> { #[account(mut)] - source: AccountInfo<'info>, - mint: AccountInfo<'info>, - delegate: AccountInfo<'info>, + source: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, + delegate: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -258,9 +258,9 @@ pub struct ApproveChecked<'info> { #[derive(Accounts)] pub struct MintToChecked<'info> { #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, owner: Signer<'info>, // optional_signer: Signer<'info>, } @@ -268,9 +268,9 @@ pub struct MintToChecked<'info> { #[derive(Accounts)] pub struct BurnChecked<'info> { #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, authority: Signer<'info>, // optional_signer: Signer<'info>, } @@ -278,56 +278,56 @@ pub struct BurnChecked<'info> { #[derive(Accounts)] pub struct InitializeAccount2<'info> { #[account(mut)] - account: AccountInfo<'info>, - mint: AccountInfo<'info>, + account: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, rent: Sysvar<'info, Rent>, } #[derive(Accounts)] pub struct SyncNative<'info> { #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InitializeAccount3<'info> { #[account(mut)] - account: AccountInfo<'info>, - mint: AccountInfo<'info>, + account: UncheckedAccount<'info>, + mint: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InitializeMultisig2<'info> { #[account(mut)] - multisig: AccountInfo<'info>, - signer: AccountInfo<'info>, + multisig: UncheckedAccount<'info>, + signer: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InitializeMint2<'info> { #[account(mut)] - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct GetAccountDataSize<'info> { - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct InitializeImmutableOwner<'info> { #[account(mut)] - account: AccountInfo<'info>, + account: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct AmountToUiAmount<'info> { - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, } #[derive(Accounts)] pub struct UiAmountToAmount<'info> { - mint: AccountInfo<'info>, + mint: UncheckedAccount<'info>, } #[account]