sablier_thread_program/instructions/
thread_reset.rs1use {
2 crate::{constants::*, state::*},
3 anchor_lang::prelude::*,
4};
5
6#[derive(Accounts)]
8pub struct ThreadReset<'info> {
9 pub authority: Signer<'info>,
11
12 #[account(
14 mut,
15 seeds = [
16 SEED_THREAD,
17 thread.authority.as_ref(),
18 thread.id.as_slice(),
19 thread.domain.as_ref().unwrap_or(&Vec::new()).as_slice()
20 ],
21 bump = thread.bump,
22 has_one = authority
23 )]
24 pub thread: Account<'info, Thread>,
25}
26
27pub fn handler(ctx: Context<ThreadReset>) -> Result<()> {
28 let thread = &mut ctx.accounts.thread;
30
31 thread.next_instruction = None;
33 thread.exec_context = None;
34 thread.created_at = Clock::get()?.into();
35
36 Ok(())
37}