pub struct TestIndexer<R: RpcConnection> {
pub state_merkle_trees: Vec<StateMerkleTreeBundle>,
pub address_merkle_trees: Vec<AddressMerkleTreeBundle>,
pub payer: Keypair,
pub group_pda: Pubkey,
pub compressed_accounts: Vec<CompressedAccountWithMerkleContext>,
pub nullified_compressed_accounts: Vec<CompressedAccountWithMerkleContext>,
pub token_compressed_accounts: Vec<TokenDataWithContext>,
pub token_nullified_compressed_accounts: Vec<TokenDataWithContext>,
pub events: Vec<PublicTransactionEvent>,
pub proof_types: Vec<ProofType>,
/* private fields */
}
Fields§
§state_merkle_trees: Vec<StateMerkleTreeBundle>
§address_merkle_trees: Vec<AddressMerkleTreeBundle>
§payer: Keypair
§group_pda: Pubkey
§compressed_accounts: Vec<CompressedAccountWithMerkleContext>
§nullified_compressed_accounts: Vec<CompressedAccountWithMerkleContext>
§token_compressed_accounts: Vec<TokenDataWithContext>
§token_nullified_compressed_accounts: Vec<TokenDataWithContext>
§events: Vec<PublicTransactionEvent>
§proof_types: Vec<ProofType>
Implementations§
Source§impl<R: RpcConnection> TestIndexer<R>
impl<R: RpcConnection> TestIndexer<R>
pub async fn init_from_env( payer: &Keypair, env: &EnvAccounts, inclusion: bool, non_inclusion: bool, ) -> Self
pub async fn new( state_merkle_tree_accounts: Vec<StateMerkleTreeAccounts>, address_merkle_tree_accounts: Vec<AddressMerkleTreeAccounts>, payer: Keypair, group_pda: Pubkey, inclusion: bool, non_inclusion: bool, ) -> Self
pub fn add_address_merkle_tree_bundle( address_merkle_tree_accounts: AddressMerkleTreeAccounts, ) -> AddressMerkleTreeBundle
pub async fn add_address_merkle_tree( &mut self, rpc: &mut R, merkle_tree_keypair: &Keypair, queue_keypair: &Keypair, owning_program_id: Option<Pubkey>, ) -> AddressMerkleTreeAccounts
pub async fn add_state_merkle_tree( &mut self, rpc: &mut R, merkle_tree_keypair: &Keypair, nullifier_queue_keypair: &Keypair, cpi_context_keypair: &Keypair, owning_program_id: Option<Pubkey>, forester: Option<Pubkey>, )
Sourcepub fn add_lamport_compressed_accounts(&mut self, event_bytes: Vec<u8>)
pub fn add_lamport_compressed_accounts(&mut self, event_bytes: Vec<u8>)
deserializes an event adds the output_compressed_accounts to the compressed_accounts removes the input_compressed_accounts from the compressed_accounts adds the input_compressed_accounts to the nullified_compressed_accounts
Sourcepub fn add_compressed_accounts_with_token_data(
&mut self,
event: &PublicTransactionEvent,
)
pub fn add_compressed_accounts_with_token_data( &mut self, event: &PublicTransactionEvent, )
deserializes an event adds the output_compressed_accounts to the compressed_accounts removes the input_compressed_accounts from the compressed_accounts adds the input_compressed_accounts to the nullified_compressed_accounts deserialiazes token data from the output_compressed_accounts adds the token_compressed_accounts to the token_compressed_accounts
Sourcepub fn get_compressed_balance(&self, owner: &Pubkey) -> u64
pub fn get_compressed_balance(&self, owner: &Pubkey) -> u64
returns the compressed sol balance of the owner pubkey
Sourcepub fn get_compressed_token_balance(&self, owner: &Pubkey, mint: &Pubkey) -> u64
pub fn get_compressed_token_balance(&self, owner: &Pubkey, mint: &Pubkey) -> u64
returns the compressed token balance of the owner pubkey for a token by mint
Trait Implementations§
Source§impl<R: Debug + RpcConnection> Debug for TestIndexer<R>
impl<R: Debug + RpcConnection> Debug for TestIndexer<R>
Source§impl<R: RpcConnection + Send + Sync + 'static> Indexer<R> for TestIndexer<R>
impl<R: RpcConnection + Send + Sync + 'static> Indexer<R> for TestIndexer<R>
Source§fn get_compressed_accounts_by_owner(
&self,
owner: &Pubkey,
) -> Vec<CompressedAccountWithMerkleContext>
fn get_compressed_accounts_by_owner( &self, owner: &Pubkey, ) -> Vec<CompressedAccountWithMerkleContext>
returns compressed_accounts with the owner pubkey does not return token accounts.
async fn get_multiple_compressed_account_proofs( &self, hashes: Vec<String>, ) -> Result<Vec<MerkleProof>, IndexerError>
async fn get_rpc_compressed_accounts_by_owner( &self, owner: &Pubkey, ) -> Result<Vec<String>, IndexerError>
async fn get_multiple_new_address_proofs( &self, merkle_tree_pubkey: [u8; 32], addresses: Vec<[u8; 32]>, ) -> Result<Vec<NewAddressProofWithContext>, IndexerError>
fn account_nullified(&mut self, merkle_tree_pubkey: Pubkey, account_hash: &str)
fn address_tree_updated( &mut self, merkle_tree_pubkey: Pubkey, context: &NewAddressProofWithContext, )
fn get_state_merkle_tree_accounts( &self, pubkeys: &[Pubkey], ) -> Vec<StateMerkleTreeAccounts>
fn add_event_and_compressed_accounts( &mut self, event: &PublicTransactionEvent, ) -> (Vec<CompressedAccountWithMerkleContext>, Vec<TokenDataWithContext>)
fn get_state_merkle_trees(&self) -> &Vec<StateMerkleTreeBundle>
fn get_state_merkle_trees_mut(&mut self) -> &mut Vec<StateMerkleTreeBundle>
fn get_address_merkle_trees(&self) -> &Vec<AddressMerkleTreeBundle>
fn get_address_merkle_trees_mut(&mut self) -> &mut Vec<AddressMerkleTreeBundle>
fn get_token_compressed_accounts(&self) -> &Vec<TokenDataWithContext>
fn get_payer(&self) -> &Keypair
fn get_group_pda(&self) -> &Pubkey
async fn create_proof_for_compressed_accounts( &mut self, compressed_accounts: Option<&[[u8; 32]]>, state_merkle_tree_pubkeys: Option<&[Pubkey]>, new_addresses: Option<&[[u8; 32]]>, address_merkle_tree_pubkeys: Option<Vec<Pubkey>>, rpc: &mut R, ) -> ProofRpcResult
fn add_address_merkle_tree_accounts( &mut self, merkle_tree_keypair: &Keypair, queue_keypair: &Keypair, _owning_program_id: Option<Pubkey>, ) -> AddressMerkleTreeAccounts
fn get_compressed_token_accounts_by_owner( &self, owner: &Pubkey, ) -> Vec<TokenDataWithContext>
fn add_state_bundle(&mut self, state_bundle: StateMerkleTreeBundle)
Auto Trait Implementations§
impl<R> Freeze for TestIndexer<R>
impl<R> RefUnwindSafe for TestIndexer<R>where
R: RefUnwindSafe,
impl<R> Send for TestIndexer<R>
impl<R> Sync for TestIndexer<R>
impl<R> Unpin for TestIndexer<R>where
R: Unpin,
impl<R> UnwindSafe for TestIndexer<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
Source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
Source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
Source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
Source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
Source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
Source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
Source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
Source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
Source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
Source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
Source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
Source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
Source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
Source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
Source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
Source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
Source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
Source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
Source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
Source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
Source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
Source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more