light_registry/account_compression_cpi/
register_program.rs1use account_compression::{
2 program::AccountCompression, utils::constants::CPI_AUTHORITY_PDA_SEED, GroupAuthority,
3};
4use anchor_lang::prelude::*;
5
6use crate::protocol_config::state::ProtocolConfigPda;
7
8#[derive(Accounts)]
9pub struct RegisterProgram<'info> {
10 #[account(mut)]
12 pub authority: Signer<'info>,
13 #[account(mut, has_one = authority)]
14 pub protocol_config_pda: Account<'info, ProtocolConfigPda>,
15 #[account(mut, seeds = [CPI_AUTHORITY_PDA_SEED], bump)]
17 pub cpi_authority: AccountInfo<'info>,
18 #[account(mut ,constraint = group_pda.authority == cpi_authority.key())]
20 pub group_pda: Account<'info, GroupAuthority>,
21 pub account_compression_program: Program<'info, AccountCompression>,
22 pub system_program: Program<'info, System>,
23 #[account(mut)]
25 pub registered_program_pda: AccountInfo<'info>,
26 pub program_to_be_registered: Signer<'info>,
29}
30
31#[derive(Accounts)]
32pub struct DeregisterProgram<'info> {
33 #[account(mut)]
35 pub authority: Signer<'info>,
36 #[account(mut, has_one = authority)]
37 pub protocol_config_pda: Account<'info, ProtocolConfigPda>,
38 #[account(mut, seeds = [CPI_AUTHORITY_PDA_SEED], bump)]
40 pub cpi_authority: AccountInfo<'info>,
41 #[account(mut ,constraint = group_pda.authority == cpi_authority.key())]
43 pub group_pda: Account<'info, GroupAuthority>,
44 pub account_compression_program: Program<'info, AccountCompression>,
45 #[account(mut)]
47 pub registered_program_pda: AccountInfo<'info>,
48}