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

Method pack_into_slice

program/src/user_account/state.rs:53–66  ·  view source on GitHub ↗
(&self, dst: &mut [u8])

Source from the content-addressed store, hash-verified

51 }
52
53 fn pack_into_slice(&self, dst: &mut [u8]) {
54 let dst = array_mut_ref![dst, 0, UserAccount::LEN];
55 let (dst_is_initialized, dst_account_type, dst_owner_pubkey, dst_enc_utxos) =
56 mut_array_refs![dst, 1, 1, 32, SIZE_UTXO * UTXO_CAPACITY];
57
58 if self.mode_init {
59 dst_is_initialized[0] = 1;
60 dst_account_type[0] = 10;
61 for (i, x) in dst_enc_utxos.iter_mut().enumerate() {
62 *x = self.enc_utxos[i]
63 }
64 *dst_owner_pubkey = self.owner_pubkey.to_bytes();
65 }
66 }
67}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected