(
client: &Client,
id: String,
rate_limit: Option<u64>,
schedule: Option<String>,
)
| 117 | } |
| 118 | |
| 119 | pub fn update( |
| 120 | client: &Client, |
| 121 | id: String, |
| 122 | rate_limit: Option<u64>, |
| 123 | schedule: Option<String>, |
| 124 | ) -> Result<(), CliError> { |
| 125 | let thread_pubkey = Thread::pubkey(client.payer_pubkey(), id.into_bytes()); |
| 126 | let trigger = if let Some(schedule) = schedule { |
| 127 | Some(Trigger::Cron { |
| 128 | schedule, |
| 129 | skippable: true, |
| 130 | }) |
| 131 | } else { |
| 132 | None |
| 133 | }; |
| 134 | let settings = ThreadSettings { |
| 135 | fee: None, |
| 136 | instructions: None, |
| 137 | name: None, |
| 138 | rate_limit, |
| 139 | trigger, |
| 140 | }; |
| 141 | let ix = Instruction { |
| 142 | program_id: clockwork_thread_program::ID, |
| 143 | accounts: clockwork_thread_program::accounts::ThreadUpdate { |
| 144 | authority: client.payer_pubkey(), |
| 145 | system_program: system_program::ID, |
| 146 | thread: thread_pubkey |
| 147 | }.to_account_metas(Some(false)), |
| 148 | data: clockwork_thread_program::instruction::ThreadUpdate { settings }.data(), |
| 149 | }; |
| 150 | client.send_and_confirm(&[ix], &[client.payer()]).unwrap(); |
| 151 | get(client, thread_pubkey)?; |
| 152 | Ok(()) |
| 153 | } |
| 154 | |
| 155 | pub fn parse_pubkey_from_id_or_address( |
| 156 | authority: Pubkey, |
nothing calls this directly
no test coverage detected