Skip to content

Commit

Permalink
fix(iota-core): code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriyr committed Oct 29, 2024
1 parent cbb2a8d commit e57c299
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions crates/iota-core/src/authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4647,12 +4647,11 @@ impl AuthorityState {
.events
.data
.iter()
.find(|event| event.is_system_epoch_info_event());
let system_epoch_info_event = system_epoch_info_event.map(|event| {
bcs::from_bytes::<SystemEpochInfoEventV1>(&event.contents).expect(
"deserialization should succeed since we asserted that the event is of this type",
)
});
.find(|event| event.is_system_epoch_info_event())
.map(|event| {
bcs::from_bytes::<SystemEpochInfoEventV1>(&event.contents)
.expect("event deserialization should succeed as type was pre-validated")
});
// The system epoch info event can be `None` in case if the `advance_epoch`
// Move function call failed and was executed in the safe mode.
assert!(system_epoch_info_event.is_some() || system_obj.safe_mode());
Expand Down

0 comments on commit e57c299

Please sign in to comment.