Skip to content

Commit

Permalink
eosmechanics: skips for loop if new block format
Browse files Browse the repository at this point in the history
  • Loading branch information
chamorin committed Oct 10, 2024
1 parent c1e0297 commit e24e0b7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion eosmechanics/src/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,20 @@ pub fn map_schedule_change(block: Block) -> Result<ScheduleChange, Error> {
None => vec![], // New ???
};

// New block format
if !block.proposer_policy.as_ref().is_none() {
return Ok(ScheduleChange {
producer: block.header.as_ref().unwrap().producer.clone(),
schedule_version: block.header.as_ref().unwrap().schedule_version,
active_schedule,
pending_schedule,
add_to_schedule: Default::default(),
remove_from_schedule: Default::default(),
});
}

// If there is no pending schedule and it's old block format, then there is no schedule change
if pending_schedule.is_empty() && block.proposer_policy.as_ref().is_none() {
if pending_schedule.is_empty() {
return Ok(Default::default());
}

Expand Down

0 comments on commit e24e0b7

Please sign in to comment.