pub trait LightFinalize<'info, P> {
// Required method
fn light_finalize(
&mut self,
remaining_accounts: &[AccountInfo<'info>],
params: &P,
has_pre_init: bool,
) -> Result<(), LightSdkError>;
}Expand description
Trait for finalizing compression operations on accounts.
§Type Parameters
'info- The account info lifetimeP- The instruction params type (from#[instruction(params: P)])
Required Methods§
Sourcefn light_finalize(
&mut self,
remaining_accounts: &[AccountInfo<'info>],
params: &P,
has_pre_init: bool,
) -> Result<(), LightSdkError>
fn light_finalize( &mut self, remaining_accounts: &[AccountInfo<'info>], params: &P, has_pre_init: bool, ) -> Result<(), LightSdkError>
Execute compression finalization.
This method is called at the end of an instruction to batch and execute
all compression CPIs for accounts marked with #[compressible(...)].
§Arguments
remaining_accounts- The remaining accounts from the context, used for CPIparams- The instruction parameters containing compression datahas_pre_init- Whetherlight_pre_initwas called and wrote to CPI context
§Errors
Returns an error if the compression CPI fails.