miclockwork_thread_program/instructions/
thread_pause.rs1use {crate::state::*, anchor_lang::prelude::*};
2
3#[derive(Accounts)]
5pub struct ThreadPause<'info> {
6 #[account()]
8 pub authority: Signer<'info>,
9
10 #[account(
12 mut,
13 seeds = [
14 SEED_THREAD,
15 thread.authority.as_ref(),
16 thread.id.as_slice(),
17 ],
18 bump = thread.bump,
19 has_one = authority
20 )]
21 pub thread: Account<'info, Thread>,
22}
23
24pub fn handler(ctx: Context<ThreadPause>) -> Result<()> {
25 let thread = &mut ctx.accounts.thread;
27
28 thread.paused = true;
30
31 Ok(())
32}