fn query_storage_unfiltered(
		&self,
		range: &QueryStorageRange<Block>,
		keys: &[StorageKey],
		changes: &mut Vec<StorageChangeSet<Block::Hash>>,
	) -> Result<()> {
		let mut last_state: HashMap<_, Option<_>> = Default::default();
		for block in range.unfiltered_range.start..range.unfiltered_range.end {
			let block_hash = range.hashes[block].clone();
			let mut block_changes = StorageChangeSet { block: block_hash.clone(), changes: Vec::new() };
			let id = BlockId::hash(block_hash);
			for key in keys {
				let (has_changed, data) = {
					let curr_data = self.client.storage(&id, key)?;
					let prev_data = last_state.get(key).and_then(|x| x.as_ref());
					(curr_data.as_ref() != prev_data, curr_data)
				};
				if has_changed {
					block_changes.changes.push((key.clone(), data.clone()));
				}
				last_state.insert(key.clone(), data);
			}
			changes.push(block_changes);
		}
		Ok(())
	}
/// Iterates through range.unfiltered_range and check each block for changes of keys' values.
Iterates through range.unfiltered_range and check each block for changes of keys' values.
Iterates through range . unfiltered_range and check each block for changes of keys ' values .
fn query_storage_unfiltered(
		&self,
		range: &QueryStorageRange<Block>,
		keys: &[StorageKey],
		changes: &mut Vec<StorageChangeSet<Block::Hash>>,
	) -> Result<()> {
		let mut last_state: HashMap<_, Option<_>> = Default::default();
		for block in range.unfiltered_range.start..range.unfiltered_range.end {
			let block_hash = range.hashes[block].clone();
			let mut block_changes = StorageChangeSet { block: block_hash.clone(), changes: Vec::new() };
			let id = BlockId::hash(block_hash);
			for key in keys {
				let (has_changed, data) = {
					let curr_data = self.client.storage(&id, key)?;
					let prev_data = last_state.get(key).and_then(|x| x.as_ref());
					(curr_data.as_ref() != prev_data, curr_data)
				};
				if has_changed {
					block_changes.changes.push((key.clone(), data.clone()));
				}
				last_state.insert(key.clone(), data);
			}
			changes.push(block_changes);
		}
		Ok(())
	}
fn query_storage_unfiltered ( & self , range : & QueryStorageRange < Block > , keys : & [ StorageKey ] , changes : & mut Vec < StorageChangeSet < Block :: Hash > > , ) -> Result < ( ) > { let mut last_state : HashMap < _ , Option < _ > > = Default :: default ( ) ; for block in range . unfiltered_range . start .. range . unfiltered_range . end { let block_hash = range . hashes [ block ] . clone ( ) ; let mut block_changes = StorageChangeSet { block : block_hash . clone ( ) , changes : Vec :: new ( ) } ; let id = BlockId :: hash ( block_hash ) ; for key in keys { let ( has_changed , data ) = { let curr_data = self . client . storage ( & id , key ) ? ; let prev_data = last_state . get ( key ) . and_then ( | x | x . as_ref ( ) ) ; ( curr_data . as_ref ( ) != prev_data , curr_data ) } ; if has_changed { block_changes . changes . push ( ( key . clone ( ) , data . clone ( ) ) ) ; } last_state . insert ( key . clone ( ) , data ) ; } changes . push ( block_changes ) ; } Ok ( ( ) ) }
Iterates through range.unfiltered_range and check each block for changes of keys' values.
Iterates through range . unfiltered_range and check each block for changes of keys ' values .
&self
range
&QueryStorageRange<Block>
keys
&[StorageKey]
changes
&mut Vec<StorageChangeSet<Block::Hash>>
&self
range
&QueryStorageRange<Block>
keys
&[StorageKey]
changes
&mut Vec<StorageChangeSet<Block::Hash>>