triggr/instructions/
close_task.rs

1pub use crate::state::*;
2use anchor_lang::{prelude::*, system_program::System};
3
4#[derive(Accounts)]
5#[instruction(_trigger_index: u64, _task_index: u8)]
6pub struct CloseTask<'info> {
7    // needs to be signed by authority
8    #[account(mut)]
9    authority: Signer<'info>,
10
11    #[account(mut, seeds = ["payer".as_bytes(), authority.key().as_ref()], bump)]
12    payer: SystemAccount<'info>,
13
14    #[account(mut, seeds = ["trigger".as_bytes(), &authority.key().as_ref(), &_trigger_index.to_le_bytes()], bump )]
15    trigger: Account<'info, Trigger>,
16
17    #[account(mut, close = authority, seeds = ["task".as_bytes(), &trigger.key().as_ref(), &_task_index.to_le_bytes()], bump)]
18    task: Account<'info, Task>,
19
20    system_program: Program<'info, System>,
21}
22
23pub fn handler(_ctx: Context<CloseTask>, _trigger_index: u64, _task_index: u8) -> Result<()> {
24    Ok(())
25}