Trait pythnet_sdk::accumulators::Accumulator
source · pub trait Accumulator<'a>{
type Proof;
// Required methods
fn prove(&'a self, item: &[u8]) -> Option<Self::Proof>;
fn check(&'a self, proof: Self::Proof, item: &[u8]) -> bool;
fn from_set(items: impl Iterator<Item = &'a [u8]>) -> Option<Self>;
}
Expand description
The Accumulator trait defines the interface for an accumulator.
This trait assumes an accumulator has an associated proof type that can be used to prove membership of a specific item. The choice to return Proof makes this the most generic implementation possible for any accumulator.
Required Associated Types§
Required Methods§
sourcefn prove(&'a self, item: &[u8]) -> Option<Self::Proof>
fn prove(&'a self, item: &[u8]) -> Option<Self::Proof>
Prove an item is a member of the accumulator.
Object Safety§
This trait is not object safe.
Implementors§
source§impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
impl<'a> Accumulator<'a> for MulAccumulator<PrimeHasher>
type Proof = <PrimeHasher as Hasher>::Hash
source§impl<'a, H: Hasher + 'a> Accumulator<'a> for MerkleTree<H>
impl<'a, H: Hasher + 'a> Accumulator<'a> for MerkleTree<H>
Presents an Accumulator friendly interface for MerkleTree.