1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use anchor_lang::{
solana_program::{
instruction::{AccountMeta, Instruction},
pubkey::Pubkey,
},
InstructionData,
};
use mat_clockwork_network_program::state::{Fee, Pool};
pub fn thread_exec(signatory: Pubkey, thread: Pubkey, worker: Pubkey) -> Instruction {
Instruction {
program_id: mat_clockwork_thread_program::ID,
accounts: vec![
AccountMeta::new(Fee::pubkey(worker), false),
AccountMeta::new_readonly(Pool::pubkey(0), false),
AccountMeta::new(signatory, true),
AccountMeta::new(thread, false),
AccountMeta::new_readonly(worker, false),
],
data: mat_clockwork_thread_program::instruction::ThreadExec {}.data(),
}
}