diff --git a/crates/executor/client/src/io.rs b/crates/executor/client/src/io.rs index acb0dd3..0c49013 100644 --- a/crates/executor/client/src/io.rs +++ b/crates/executor/client/src/io.rs @@ -40,7 +40,7 @@ impl ClientExecutorInput { /// /// Note: This mutates the input and takes ownership of used storage proofs and block hashes /// to avoid unnecessary cloning. - pub fn witness_db(&mut self) -> Result { + pub fn witness_db(&self) -> Result { let state_root: B256 = self.parent_header().state_root; if state_root != self.parent_state.state_root() { eyre::bail!("parent state root mismatch"); @@ -51,8 +51,7 @@ impl ClientExecutorInput { let mut accounts = HashMap::new(); let mut storage = HashMap::new(); - let state_requests = std::mem::take(&mut self.state_requests); - for (address, slots) in state_requests { + for (&address, slots) in self.state_requests.iter() { let hashed_address = keccak256(address); let hashed_address = hashed_address.as_slice(); @@ -87,7 +86,7 @@ impl ClientExecutorInput { .get(hashed_address) .ok_or_else(|| eyre::eyre!("parent state does not contain storage trie"))?; - for slot in slots { + for &slot in slots { let slot_value = storage_trie .get_rlp::(keccak256(slot.to_be_bytes::<32>()).as_slice())? .unwrap_or_default();