pub fn create_cpi_accounts_and_instruction_data<'a>(
output_compressed_accounts: &[OutputCompressedAccountWithPackedContext],
output_compressed_account_indices: &mut [u32],
output_compressed_account_hashes: &mut [[u8; 32]],
compressed_account_addresses: &mut Vec<Option<[u8; 32]>>,
invoking_program: &Option<Pubkey>,
hashed_pubkeys: &mut Vec<(Pubkey, [u8; 32])>,
sequence_numbers: &mut Vec<MerkleTreeSequenceNumber>,
remaining_accounts: &'a [AccountInfo<'a>],
account_infos: &mut Vec<AccountInfo<'a>>,
accounts: &mut Vec<AccountMeta>,
) -> Result<Vec<u8>>
Expand description
Creates CPI accounts, instruction data, and performs checks.
- Merkle tree indices must be in order.
- Hashes output accounts for insertion and event.
- Collects sequence numbers for event.
Checks:
- Checks whether a Merkle tree is program owned, if so checks write eligibility.
- Checks ordering of Merkle tree indices.
- Checks that addresses in output compressed accounts have been created or exist in input compressed accounts. An address may not be used in an output compressed accounts. This will close the account.