From e24e0b73ce018e8449816151eb2ae90bdf3d995a Mon Sep 17 00:00:00 2001 From: Charles Morin Date: Thu, 10 Oct 2024 10:56:30 -0400 Subject: [PATCH] eosmechanics: skips for loop if new block format --- eosmechanics/src/maps.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/eosmechanics/src/maps.rs b/eosmechanics/src/maps.rs index 06261d4..ca7722d 100644 --- a/eosmechanics/src/maps.rs +++ b/eosmechanics/src/maps.rs @@ -67,8 +67,20 @@ pub fn map_schedule_change(block: Block) -> Result { 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()); }