chunk_loader/
lib.rs

1#![allow(unexpected_cfgs)]
2
3use crate::{instructions::*, state::*};
4use anchor_lang::prelude::*;
5
6pub mod error;
7mod instructions;
8pub mod state;
9mod utils;
10
11// DO NOT EDIT the address manually. Instead, run `./switch-env.sh`
12declare_id!("ChUnQ7H46X5UeQJHVgZFBy3hGM95TwWsmvBRwQxVz3JG");
13
14#[cfg(not(feature = "no-entrypoint"))]
15solana_security_txt::security_txt! {
16    name: "Chunk Loader",
17    project_url: "https://crates.io/crates/solana-chunk-loader",
18    contacts: "email:lincot@disroot.org,discord:lincot",
19    policy: "Please contact us if you have discovered a bug"
20}
21
22#[program]
23pub mod chunk_loader {
24    use super::*;
25
26    #[instruction(discriminator = [1])]
27    pub fn load_chunk(ctx: Context<LoadChunk>, chunk_holder_id: u32, chunk: Chunk) -> Result<()> {
28        instructions::load_chunk(ctx, chunk_holder_id, chunk)
29    }
30
31    #[instruction(discriminator = [2])]
32    pub fn pass_to_cpi(ctx: Context<PassToCpi>) -> Result<()> {
33        instructions::pass_to_cpi(ctx)
34    }
35
36    #[instruction(discriminator = [3])]
37    pub fn close_chunks(ctx: Context<CloseChunks>) -> Result<()> {
38        instructions::close_chunks(ctx)
39    }
40
41    #[instruction(discriminator = [4])]
42    pub fn pass_to_cpi_checked(ctx: Context<PassToCpi>, expected_length: u16) -> Result<()> {
43        instructions::pass_to_cpi_checked(ctx, expected_length)
44    }
45}