Trait clockwork_thread_program::state::ThreadAccount
source · pub trait ThreadAccount {
fn pubkey(&self) -> Pubkey;
fn init(
&mut self,
authority: Pubkey,
id: String,
kickoff_instruction: InstructionData,
trigger: Trigger
) -> Result<()>;
fn exec(
&mut self,
account_infos: &[AccountInfo<'_>],
bump: u8,
fee: &mut Account<'_, Fee>,
penalty: &mut Account<'_, Penalty>,
pool: &Account<'_, Pool>,
signatory: &mut Signer<'_>,
worker: &Account<'_, Worker>
) -> Result<()>;
fn kickoff(&mut self, remaining_accounts: &[AccountInfo<'_>]) -> Result<()>;
fn realloc(&mut self) -> Result<()>;
fn update(&mut self, settings: ThreadSettings) -> Result<()>;
}
Expand description
Trait for reading and writing to a thread account.
Required Methods§
sourcefn init(
&mut self,
authority: Pubkey,
id: String,
kickoff_instruction: InstructionData,
trigger: Trigger
) -> Result<()>
fn init(
&mut self,
authority: Pubkey,
id: String,
kickoff_instruction: InstructionData,
trigger: Trigger
) -> Result<()>
Initialize the account to hold thread object.
sourcefn exec(
&mut self,
account_infos: &[AccountInfo<'_>],
bump: u8,
fee: &mut Account<'_, Fee>,
penalty: &mut Account<'_, Penalty>,
pool: &Account<'_, Pool>,
signatory: &mut Signer<'_>,
worker: &Account<'_, Worker>
) -> Result<()>
fn exec(
&mut self,
account_infos: &[AccountInfo<'_>],
bump: u8,
fee: &mut Account<'_, Fee>,
penalty: &mut Account<'_, Penalty>,
pool: &Account<'_, Pool>,
signatory: &mut Signer<'_>,
worker: &Account<'_, Worker>
) -> Result<()>
Execute the next instruction on the thread.