MCPcopy Create free account
hub / github.com/Lightprotocol/light-protocol-v1 / create_pubkeys_from_ix_data

Function create_pubkeys_from_ix_data

program/tests/onchain.rs:522–541  ·  view source on GitHub ↗
(
    ix_data: &Vec<u8>,
    program_id: &Pubkey,
)

Source from the content-addressed store, hash-verified

520 assert_eq!(*encrypted_utxos, two_leaves_pda_account.data[106..]);
521}
522async fn create_pubkeys_from_ix_data(
523 ix_data: &Vec<u8>,
524 program_id: &Pubkey,
525) -> (Pubkey, Pubkey, Pubkey, Pubkey) {
526 // Creates pubkeys for all the PDAs we'll use
527 let tmp_storage_pda_pubkey =
528 Pubkey::find_program_address(&[&ix_data[73..105], &b"storage"[..]], &program_id).0;
529 let two_leaves_pda_pubkey =
530 Pubkey::find_program_address(&[&ix_data[105..137], &b"leaves"[..]], program_id).0;
531
532 let nf_pubkey0 = Pubkey::find_program_address(&[&ix_data[105..137], &b"nf"[..]], program_id).0;
533
534 let nf_pubkey1 = Pubkey::find_program_address(&[&ix_data[137..169], &b"nf"[..]], program_id).0;
535 (
536 tmp_storage_pda_pubkey,
537 two_leaves_pda_pubkey,
538 nf_pubkey0,
539 nf_pubkey1,
540 )
541}
542
543async fn transact(
544 program_id: &Pubkey,

Calls

no outgoing calls

Tested by

no test coverage detected