light_system_program/
lib.rs1use anchor_lang::prelude::*;
2
3pub mod account_traits;
4pub mod constants;
5pub mod errors;
6pub mod instructions;
7pub mod utils;
8pub use instructions::*;
9pub mod cpi_context_account;
10use light_compressed_account::instruction_data::{
11 with_account_info::InstructionDataInvokeCpiWithAccountInfo,
12 with_readonly::InstructionDataInvokeCpiWithReadOnly,
13};
14
15declare_id!("SySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7");
16
17#[program]
18pub mod light_system_program {
19 #![allow(unused_variables)]
20
21 use super::*;
22
23 pub fn init_cpi_context_account(ctx: Context<InitializeCpiContextAccount>) -> Result<()> {
24 unimplemented!("anchor wrapper not implemented")
25 }
26
27 pub fn invoke(ctx: Context<InvokeInstruction>, inputs: Vec<u8>) -> Result<()> {
28 unimplemented!("anchor wrapper not implemented")
29 }
30
31 pub fn invoke_cpi(ctx: Context<InvokeCpiInstruction>, inputs: Vec<u8>) -> Result<()> {
32 unimplemented!("anchor wrapper not implemented")
33 }
34
35 pub fn invoke_cpi_with_read_only(
36 ctx: Context<InvokeCpiInstruction>,
37 inputs: InstructionDataInvokeCpiWithReadOnly,
38 ) -> Result<()> {
39 unimplemented!("anchor wrapper not implemented")
40 }
41 pub fn invoke_cpi_with_account_info(
42 ctx: Context<InvokeCpiInstruction>,
43 inputs: InstructionDataInvokeCpiWithAccountInfo,
44 ) -> Result<()> {
45 unimplemented!("anchor wrapper not implemented")
46 }
47
48 }
61
62#[test]
63fn test_borsh_equivalence() {
64 use anchor_lang::prelude::borsh::BorshSerialize;
65 let struct_a = InstructionDataInvokeCpiWithAccountInfo {
66 mode: 1,
67 bump: 255,
68 invoking_program_id: light_compressed_account::pubkey::Pubkey::new_unique(),
69 ..Default::default()
70 };
71 #[derive(BorshSerialize)]
72 pub struct AnchorWrapped {
73 inputs: InstructionDataInvokeCpiWithAccountInfo,
74 }
75
76 let struct_b = AnchorWrapped {
77 inputs: struct_a.clone(),
78 };
79
80 let struct_a_bytes: Vec<u8> = struct_a.try_to_vec().unwrap();
81 let struct_b_bytes: Vec<u8> = struct_b.try_to_vec().unwrap();
82 assert_eq!(struct_a_bytes, struct_b_bytes);
83}