This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
pub fn test_ix<'info>( | |
ctx: Context<'_, '_, '_, 'info, TestIx<'info>>, | |
test1: u8, | |
test2: u16, | |
test3: u32, | |
) -> Result<()> { | |
msg!("test1 {}", test1); | |
msg!("test2 {}", test2); | |
msg!("test3 {}", test3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[derive(Accounts)] | |
pub struct Initialize<'info> { | |
#[account(mut)] | |
wallet: Signer<'info>, | |
#[account(init, payer=wallet, space=100)] | |
foo_account: Account<'info, FooAccount>, | |
system_program: Program<'info, System>, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
pub fn test_ix<'info>( | |
_ctx: Context<'_, '_, '_, 'info, TestIx<'info>>, | |
) -> Result<()> { | |
Ok(()) | |
} | |
// New code | |
pub fn test_ix<'info>( | |
_ctx: Context<'_, '_, '_, 'info, TestIx<'info>>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { | |
foo_account: Account<'info, FooAccount>, | |
bar_account: Account<'info, BarAccount>, | |
} | |
// New code | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
pub fn print_accounts<'info>( | |
ctx: Context<'_, '_, '_, 'info, PrintAccounts<'info>>, | |
) -> Result<()> { | |
Ok(()) | |
} | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { | |
foo_account: Account<'info, FooAccount>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[derive(Accounts)] | |
pub struct TestIx<'info> { | |
account1: UncheckedAccount<'info>, | |
} | |
// New code | |
#[derive(Accounts)] | |
pub struct TestIx<'info> { | |
account1: UncheckedAccount<'info>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { | |
foo_account: Account<'info, FooAccount>, | |
#[account(mut)] | |
bar_account: Account<'info, BarAccount>, | |
} | |
// New code | |
#[derive(Accounts)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
pub fn test_ix<'info>( | |
ctx: Context<'_, '_, '_, 'info, TestIx<'info>>, | |
test1: Option<bool>, | |
test2: Option<bool>, | |
) -> Result<()> { | |
Ok(()) | |
} | |
// New code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { | |
foo_account: Account<'info, FooAccount>, | |
bar_account: Account<'info, BarAccount>, | |
} | |
// New code | |
#[derive(Accounts)] | |
pub struct PrintAccounts<'info> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Old code | |
#[account] | |
pub struct FooAccount { | |
pubkey: Option<Pubkey>, | |
} | |
// New code | |
#[account] | |
pub struct FooAccount { | |
pubkey: Option<Pubkey>, |
NewerOlder