antegen_thread_program/instructions/
thread_delete.rs1use crate::{errors::AntegenThreadError, state::ThreadConfig, *};
2use anchor_lang::prelude::*;
3
4#[derive(Accounts)]
7pub struct ThreadDelete<'info> {
8 #[account(
10 mut,
11 constraint = admin.key() == config.admin @ AntegenThreadError::InvalidConfigAdmin,
12 )]
13 pub admin: Signer<'info>,
14
15 #[account(
17 seeds = [SEED_CONFIG],
18 bump = config.bump,
19 )]
20 pub config: Account<'info, ThreadConfig>,
21
22 #[account(
24 mut,
25 close = admin,
26 )]
27 pub thread: Account<'info, Thread>,
28}
29
30pub fn thread_delete(_ctx: Context<ThreadDelete>) -> Result<()> {
31 msg!("Deleting thread (admin)");
32 Ok(())
33}