pub fn key_changes_proof<S: Storage<H>, H: Hasher>(
	config: &Configuration,
	storage: &S,
	begin: u64,
	end: &AnchorBlockId<H::Out>,
	max: u64,
	key: &[u8],
) -> Result<Vec<Vec<u8>>, String> where H::Out: HeapSizeOf {
	// we can't query any roots before root
	let max = ::std::cmp::min(max, end.number);

	let mut iter = ProvingDrilldownIterator {
		essence: DrilldownIteratorEssence {
			key,
			roots_storage: storage.clone(),
			storage,
			begin,
			end,
			surface: surface_iterator(config, max, begin, end.number)?,

			extrinsics: Default::default(),
			blocks: Default::default(),

			_hasher: ::std::marker::PhantomData::<H>::default(),
		},
		proof_recorder: Default::default(),
	};

	// iterate to collect proof
	while let Some(item) = iter.next() {
		item?;
	}

	Ok(iter.extract_proof())
}
/// Returns proof of changes of given key at given blocks range.
/// `max` is the number of best known block.
Returns proof of changes of given key at given blocks range.
`max` is the number of best known block.
Returns proof of changes of given key at given blocks range . ` max ` is the number of best known block .
pub fn key_changes_proof<S: Storage<H>, H: Hasher>(
	config: &Configuration,
	storage: &S,
	begin: u64,
	end: &AnchorBlockId<H::Out>,
	max: u64,
	key: &[u8],
) -> Result<Vec<Vec<u8>>, String> where H::Out: HeapSizeOf {
	// we can't query any roots before root
	let max = ::std::cmp::min(max, end.number);
	let mut iter = ProvingDrilldownIterator {
		essence: DrilldownIteratorEssence {
			key,
			roots_storage: storage.clone(),
			storage,
			begin,
			end,
			surface: surface_iterator(config, max, begin, end.number)?,
			extrinsics: Default::default(),
			blocks: Default::default(),
			_hasher: ::std::marker::PhantomData::<H>::default(),
		},
		proof_recorder: Default::default(),
	};
	// iterate to collect proof
	while let Some(item) = iter.next() {
		item?;
	}
	Ok(iter.extract_proof())
}
pub fn key_changes_proof < S : Storage < H > , H : Hasher > ( config : & Configuration , storage : & S , begin : u64 , end : & AnchorBlockId < H :: Out > , max : u64 , key : & [ u8 ] , ) -> Result < Vec < Vec < u8 > > , String > where H :: Out : HeapSizeOf { // we can't query any roots before root let max = :: std :: cmp :: min ( max , end . number ) ; let mut iter = ProvingDrilldownIterator { essence : DrilldownIteratorEssence { key , roots_storage : storage . clone ( ) , storage , begin , end , surface : surface_iterator ( config , max , begin , end . number ) ? , extrinsics : Default :: default ( ) , blocks : Default :: default ( ) , _hasher : :: std :: marker :: PhantomData :: < H > :: default ( ) , } , proof_recorder : Default :: default ( ) , } ; // iterate to collect proof while let Some ( item ) = iter . next ( ) { item ? ; } Ok ( iter . extract_proof ( ) ) }
Returns proof of changes of given key at given blocks range.
Returns proof of changes of given key at given blocks range .
config
&Configuration
storage
&S
begin
u64
end
&AnchorBlockId<H::Out>
max
u64
key
&[u8]
config
&Configuration
storage
&S
begin
u64
end
&AnchorBlockId<H::Out>
max
u64
key
&[u8]