fn query_storage_filtered(
		&self,
		range: &QueryStorageRange<Block>,
		keys: &[StorageKey],
		changes: &mut Vec<StorageChangeSet<Block::Hash>>,
	) -> Result<()> {
		let (begin, end) = match range.filtered_range {
			Some(ref filtered_range) => (
				range.first_number + As::sa(filtered_range.start as u64),
				BlockId::Hash(range.hashes[filtered_range.end - 1].clone())
			),
			None => return Ok(()),
		};
		let mut changes_map: BTreeMap<NumberFor<Block>, StorageChangeSet<Block::Hash>> = BTreeMap::new();
		for key in keys {
			let mut last_block = None;
			for (block, _) in self.client.key_changes(begin, end, key)? {
				if last_block == Some(block) {
					continue;
				}
				let block_hash = range.hashes[(block - range.first_number).as_() as usize].clone();
				let id = BlockId::Hash(block_hash);
				let value_at_block = self.client.storage(&id, key)?;
				changes_map.entry(block)
					.or_insert_with(|| StorageChangeSet { block: block_hash, changes: Vec::new() })
					.changes.push((key.clone(), value_at_block));
				last_block = Some(block);
			}
		}
		if let Some(additional_capacity) = changes_map.len().checked_sub(changes.len()) {
			changes.reserve(additional_capacity);
		}
		changes.extend(changes_map.into_iter().map(|(_, cs)| cs));
		Ok(())
	}
/// Iterates through all blocks that are changing keys within range.filtered_range and collects these changes.
Iterates through all blocks that are changing keys within range.filtered_range and collects these changes.
Iterates through all blocks that are changing keys within range . filtered_range and collects these changes .
fn query_storage_filtered(
		&self,
		range: &QueryStorageRange<Block>,
		keys: &[StorageKey],
		changes: &mut Vec<StorageChangeSet<Block::Hash>>,
	) -> Result<()> {
		let (begin, end) = match range.filtered_range {
			Some(ref filtered_range) => (
				range.first_number + As::sa(filtered_range.start as u64),
				BlockId::Hash(range.hashes[filtered_range.end - 1].clone())
			),
			None => return Ok(()),
		};
		let mut changes_map: BTreeMap<NumberFor<Block>, StorageChangeSet<Block::Hash>> = BTreeMap::new();
		for key in keys {
			let mut last_block = None;
			for (block, _) in self.client.key_changes(begin, end, key)? {
				if last_block == Some(block) {
					continue;
				}
				let block_hash = range.hashes[(block - range.first_number).as_() as usize].clone();
				let id = BlockId::Hash(block_hash);
				let value_at_block = self.client.storage(&id, key)?;
				changes_map.entry(block)
					.or_insert_with(|| StorageChangeSet { block: block_hash, changes: Vec::new() })
					.changes.push((key.clone(), value_at_block));
				last_block = Some(block);
			}
		}
		if let Some(additional_capacity) = changes_map.len().checked_sub(changes.len()) {
			changes.reserve(additional_capacity);
		}
		changes.extend(changes_map.into_iter().map(|(_, cs)| cs));
		Ok(())
	}
fn query_storage_filtered ( & self , range : & QueryStorageRange < Block > , keys : & [ StorageKey ] , changes : & mut Vec < StorageChangeSet < Block :: Hash > > , ) -> Result < ( ) > { let ( begin , end ) = match range . filtered_range { Some ( ref filtered_range ) => ( range . first_number + As :: sa ( filtered_range . start as u64 ) , BlockId :: Hash ( range . hashes [ filtered_range . end - 1 ] . clone ( ) ) ) , None => return Ok ( ( ) ) , } ; let mut changes_map : BTreeMap < NumberFor < Block > , StorageChangeSet < Block :: Hash > > = BTreeMap :: new ( ) ; for key in keys { let mut last_block = None ; for ( block , _ ) in self . client . key_changes ( begin , end , key ) ? { if last_block == Some ( block ) { continue ; } let block_hash = range . hashes [ ( block - range . first_number ) . as_ ( ) as usize ] . clone ( ) ; let id = BlockId :: Hash ( block_hash ) ; let value_at_block = self . client . storage ( & id , key ) ? ; changes_map . entry ( block ) . or_insert_with ( | | StorageChangeSet { block : block_hash , changes : Vec :: new ( ) } ) . changes . push ( ( key . clone ( ) , value_at_block ) ) ; last_block = Some ( block ) ; } } if let Some ( additional_capacity ) = changes_map . len ( ) . checked_sub ( changes . len ( ) ) { changes . reserve ( additional_capacity ) ; } changes . extend ( changes_map . into_iter ( ) . map ( | ( _ , cs ) | cs ) ) ; Ok ( ( ) ) }
Iterates through all blocks that are changing keys within range.filtered_range and collects these changes.
Iterates through all blocks that are changing keys within range . filtered_range and collects these changes .
&self
range
&QueryStorageRange<Block>
keys
&[StorageKey]
changes
&mut Vec<StorageChangeSet<Block::Hash>>
&self
range
&QueryStorageRange<Block>
keys
&[StorageKey]
changes
&mut Vec<StorageChangeSet<Block::Hash>>