account_compression/utils/
queue.rs1use std::collections::HashMap;
2
3use anchor_lang::prelude::{AccountInfo, Pubkey};
4use light_merkle_tree_metadata::QueueType;
5
6pub type QueueMap<'a, 'info> = HashMap<Pubkey, QueueBundle<'a, 'info>>;
12
13pub struct QueueBundle<'a, 'info> {
19 pub queue_type: QueueType,
20 pub accounts: Vec<&'info AccountInfo<'info>>,
21 pub elements: Vec<&'a [u8; 32]>,
22 pub indices: Vec<u32>,
23 pub prove_by_index: Vec<bool>,
24}
25
26impl<'info> QueueBundle<'_, 'info> {
27 pub fn new(queue_type: QueueType, accounts: Vec<&'info AccountInfo<'info>>) -> Self {
28 Self {
29 queue_type,
30 accounts,
31 elements: Vec::new(),
32 indices: Vec::new(),
33 prove_by_index: Vec::new(),
34 }
35 }
36}