/// Creates a new MMR cache with access to the provided set of shared checkpoints.
Creates a new MMR cache with access to the provided set of shared checkpoints.
Creates a new MMR cache with access to the provided set of shared checkpoints .
pub fn new(
        base_mmr: BaseBackend,
        checkpoints: CpBackend,
        config: MmrCacheConfig,
    ) -> Result<MmrCache<D, BaseBackend, CpBackend>, MerkleMountainRangeError>
    {
        let base_mmr = MutableMmr::new(base_mmr, Bitmap::create())?;
        let curr_mmr = prune_mutable_mmr::<D, _>(&base_mmr)?;
        let mut mmr_cache = MmrCache {
            base_cp_index: 0,
            curr_cp_index: 0,
            base_mmr,
            curr_mmr,
            checkpoints,
            config,
        };
        mmr_cache.reset()?;
        Ok(mmr_cache)
    }
pub fn new ( base_mmr : BaseBackend , checkpoints : CpBackend , config : MmrCacheConfig , ) -> Result < MmrCache < D , BaseBackend , CpBackend > , MerkleMountainRangeError > { let base_mmr = MutableMmr :: new ( base_mmr , Bitmap :: create ( ) ) ? ; let curr_mmr = prune_mutable_mmr :: < D , _ > ( & base_mmr ) ? ; let mut mmr_cache = MmrCache { base_cp_index : 0 , curr_cp_index : 0 , base_mmr , curr_mmr , checkpoints , config , } ; mmr_cache . reset ( ) ? ; Ok ( mmr_cache ) }
Creates a new MMR cache with access to the provided set of shared checkpoints.
Creates a new MMR cache with access to the provided set of shared checkpoints .
base_mmr
BaseBackend
checkpoints
CpBackend
config
MmrCacheConfig