LightFinalize

Trait LightFinalize 

Source
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 lifetime
  • P - The instruction params type (from #[instruction(params: P)])

Required Methods§

Source

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 CPI
  • params - The instruction parameters containing compression data
  • has_pre_init - Whether light_pre_init was called and wrote to CPI context
§Errors

Returns an error if the compression CPI fails.

Implementors§