mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix: filter out empty storage entries in state diff (#5230)
This commit is contained in:
@ -589,8 +589,9 @@ where
|
|||||||
let account_code = load_account_code(&db, &changed_acc.info).unwrap_or_default();
|
let account_code = load_account_code(&db, &changed_acc.info).unwrap_or_default();
|
||||||
entry.code = Delta::Added(account_code);
|
entry.code = Delta::Added(account_code);
|
||||||
|
|
||||||
// new storage values
|
// new storage values are marked as added,
|
||||||
for (key, slot) in changed_acc.storage.iter() {
|
// however we're filtering changed here to avoid adding entries for the zero value
|
||||||
|
for (key, slot) in changed_acc.storage.iter().filter(|(_, slot)| slot.is_changed()) {
|
||||||
entry.storage.insert((*key).into(), Delta::Added(slot.present_value.into()));
|
entry.storage.insert((*key).into(), Delta::Added(slot.present_value.into()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user