Skip to content

Commit 27115ac

Browse files
committed
cleanup
1 parent 7758cab commit 27115ac

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

crates/cheatcodes/src/evm.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,10 +1411,11 @@ fn get_recorded_state_diffs(ccx: &mut CheatsCtxt) -> BTreeMap<Address, AccountSt
14111411
.as_ref()
14121412
.and_then(|slots| slots.get(&storage_access.account));
14131413

1414-
let mut slot_info = layout.and_then(|layout| {
1414+
let slot_info = layout.and_then(|layout| {
14151415
let decoder = SlotIdentifier::new(layout.clone());
1416-
decoder.identify(&storage_access.slot, mapping_slots).or_else(
1417-
|| {
1416+
decoder
1417+
.identify(&storage_access.slot, mapping_slots)
1418+
.or_else(|| {
14181419
// Create a map of new values for bytes/string
14191420
// identification. These values are used to determine
14201421
// the length of the data which helps determine how many
@@ -1427,27 +1428,26 @@ fn get_recorded_state_diffs(ccx: &mut CheatsCtxt) -> BTreeMap<Address, AccountSt
14271428
&storage_access.slot,
14281429
&current_base_slot_values,
14291430
)
1430-
},
1431-
)
1431+
})
1432+
.and_then(|mut info| {
1433+
// Always decode values first
1434+
info.decode_values(
1435+
storage_access.previousValue,
1436+
storage_access.newValue,
1437+
);
1438+
1439+
// Then handle long bytes/strings if applicable
1440+
if info.is_bytes_or_string() {
1441+
info.decode_bytes_or_string_values(
1442+
&storage_access.slot,
1443+
&raw_changes_by_slot,
1444+
);
1445+
}
1446+
1447+
Some(info)
1448+
})
14321449
});
14331450

1434-
// Decode values if we have slot info
1435-
if let Some(info) = &mut slot_info {
1436-
// Always decode values first
1437-
info.decode_values(
1438-
storage_access.previousValue,
1439-
storage_access.newValue,
1440-
);
1441-
1442-
// Then handle long bytes/strings if applicable
1443-
if info.is_bytes_or_string() {
1444-
info.decode_bytes_or_string_values(
1445-
&storage_access.slot,
1446-
&raw_changes_by_slot,
1447-
);
1448-
}
1449-
}
1450-
14511451
slot_state_diff.insert(SlotStateDiff {
14521452
previous_value: storage_access.previousValue,
14531453
new_value: storage_access.newValue,

0 commit comments

Comments
 (0)