(
client: &Client,
id: String,
instructions: Vec<SerializableInstruction>,
trigger: Trigger,
)
| 22 | } |
| 23 | |
| 24 | pub fn create( |
| 25 | client: &Client, |
| 26 | id: String, |
| 27 | instructions: Vec<SerializableInstruction>, |
| 28 | trigger: Trigger, |
| 29 | ) -> Result<(), CliError> { |
| 30 | let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.clone().into_bytes()); |
| 31 | let ix = Instruction { |
| 32 | program_id: clockwork_thread_program::ID, |
| 33 | accounts: clockwork_thread_program::accounts::ThreadCreate { |
| 34 | authority: client.payer_pubkey(), |
| 35 | payer: client.payer_pubkey(), |
| 36 | system_program: system_program::ID, |
| 37 | thread: thread_pubkey |
| 38 | }.to_account_metas(Some(false)), |
| 39 | data: clockwork_thread_program::instruction::ThreadCreate { |
| 40 | amount: 0, |
| 41 | id: id.into_bytes(), |
| 42 | instructions, |
| 43 | trigger, |
| 44 | } |
| 45 | .data(), |
| 46 | }; |
| 47 | client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); |
| 48 | get(client, thread_pubkey)?; |
| 49 | Ok(()) |
| 50 | } |
| 51 | |
| 52 | pub fn delete(client: &Client, id: String) -> Result<(), CliError> { |
| 53 | let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); |
no test coverage detected