Function zebra_state::service::check::nullifier::find_duplicate_nullifier

source ยท
fn find_duplicate_nullifier<'a, NullifierT, FinalizedStateContainsFn, NonFinalizedStateContainsFn>(
    revealed_nullifiers: impl IntoIterator<Item = &'a NullifierT>,
    finalized_chain_contains: FinalizedStateContainsFn,
    non_finalized_chain_contains: Option<NonFinalizedStateContainsFn>,
) -> Result<(), ValidateContextError>
where NullifierT: DuplicateNullifierError + 'a, FinalizedStateContainsFn: Fn(&'a NullifierT) -> bool, NonFinalizedStateContainsFn: Fn(&'a NullifierT) -> bool,
Expand description

Accepts an iterator of revealed nullifiers, a predicate fn for checking if a nullifier is in in the finalized chain, and a predicate fn for checking if the nullifier is in the non-finalized chain

Returns Err(DuplicateNullifierError) if any of the revealed_nullifiers are found in the non-finalized or finalized chains.

Returns Ok(()) if all the revealed_nullifiers have not been seen in either chain.