//! Misc example is a catchall program for testing unrelated features. //! It's not too instructive/coherent by itself, so please see other examples. use anchor_lang::prelude::*; #[program] pub mod misc { use super::*; pub const SIZE: u64 = 99; #[state(SIZE)] pub struct MyState { pub v: Vec, } impl MyState { pub fn new(_ctx: Context) -> Result { Ok(Self { v: vec![] }) } } pub fn initialize(ctx: Context, udata: u128, idata: i128) -> ProgramResult { ctx.accounts.data.udata = udata; ctx.accounts.data.idata = idata; Ok(()) } pub fn test_executable(ctx: Context) -> ProgramResult { Ok(()) } } #[derive(Accounts)] pub struct Ctor {} #[derive(Accounts)] pub struct Initialize<'info> { #[account(init)] data: ProgramAccount<'info, Data>, rent: Sysvar<'info, Rent>, } #[derive(Accounts)] pub struct TestExecutable<'info> { #[account(executable)] program: AccountInfo<'info>, } #[account] pub struct Data { udata: u128, idata: i128, }