chore(witness): simplify wiped storage retrieval (#12637)

This commit is contained in:
Roman Krasiuk
2024-11-18 16:51:46 +01:00
committed by GitHub
parent 1d2934ba69
commit 8aa9b71ef7

View File

@ -213,11 +213,10 @@ where
let mut storage_cursor =
self.hashed_cursor_factory.hashed_storage_cursor(*hashed_address)?;
// position cursor at the start
if let Some((hashed_slot, _)) = storage_cursor.seek(B256::ZERO)? {
storage_keys.insert(hashed_slot);
}
while let Some((hashed_slot, _)) = storage_cursor.next()? {
let mut current_entry = storage_cursor.seek(B256::ZERO)?;
while let Some((hashed_slot, _)) = current_entry {
storage_keys.insert(hashed_slot);
current_entry = storage_cursor.next()?;
}
}
proof_targets.insert(*hashed_address, storage_keys);