(ctx: Context<ThreadReset>)
| 22 | } |
| 23 | |
| 24 | pub fn handler(ctx: Context<ThreadReset>) -> Result<()> { |
| 25 | // Get accounts |
| 26 | let thread = &mut ctx.accounts.thread; |
| 27 | |
| 28 | // Full reset the thread state. |
| 29 | thread.next_instruction = None; |
| 30 | thread.exec_context = None; |
| 31 | thread.created_at = Clock::get().unwrap().into(); |
| 32 | |
| 33 | Ok(()) |
| 34 | } |