chunk_loader/
lib.rs

1#![allow(unexpected_cfgs)]
2
3use crate::{instructions::*, state::*};
4use anchor_lang::prelude::*;
5
6mod instructions;
7pub mod state;
8mod utils;
9
10// DO NOT EDIT the address manually. Instead, run `./switch-env.sh`
11declare_id!("ChUnQ7H46X5UeQJHVgZFBy3hGM95TwWsmvBRwQxVz3JG");
12
13#[program]
14pub mod chunk_loader {
15    use super::*;
16
17    #[instruction(discriminator = [1])]
18    pub fn load_chunk(ctx: Context<LoadChunk>, chunk_holder_id: u32, chunk: Chunk) -> Result<()> {
19        instructions::load_chunk(ctx, chunk_holder_id, chunk)
20    }
21
22    #[instruction(discriminator = [2])]
23    pub fn pass_to_cpi(ctx: Context<PassToCpi>) -> Result<()> {
24        instructions::pass_to_cpi(ctx)
25    }
26
27    #[instruction(discriminator = [3])]
28    pub fn close_chunks(ctx: Context<CloseChunks>) -> Result<()> {
29        instructions::close_chunks(ctx)
30    }
31}