antegen_thread_program/instructions/
thread_memo.rs

1use anchor_lang::prelude::*;
2
3use crate::state::Signal;
4
5/// Accounts for thread_memo - simple memo functionality for thread testing.
6#[derive(Accounts)]
7pub struct ThreadMemo<'info> {
8    pub signer: Signer<'info>,
9}
10
11pub fn thread_memo(
12    _ctx: Context<ThreadMemo>,
13    memo: String,
14    signal: Option<Signal>,
15) -> Result<Signal> {
16    msg!("Thread memo: {}", memo);
17
18    if signal.is_some() {
19        let response: Signal = signal.unwrap();
20        return Ok(response);
21    }
22
23    Ok(Signal::None)
24}