diff --git a/eosmechanics/Cargo.toml b/eosmechanics/Cargo.toml index 38f66b0..64a0c89 100644 --- a/eosmechanics/Cargo.toml +++ b/eosmechanics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "eosmechanics" -version = "0.3.6" +version = "0.3.7" authors = ["Denis ", "Fred ", "Charles "] description = "Block Producer Benchmarks" license = "MIT OR Apache-2.0" @@ -17,7 +17,6 @@ crate-type = ["cdylib"] prost = { workspace = true } prost-types = { workspace = true } substreams = { workspace = true } -# substreams-antelope = { workspace = true } substreams-antelope = "0.5" substreams-sink-kv = { workspace = true } substreams-sink-prometheus = { workspace = true } diff --git a/eosmechanics/src/maps.rs b/eosmechanics/src/maps.rs index 0ceaebe..f88268d 100644 --- a/eosmechanics/src/maps.rs +++ b/eosmechanics/src/maps.rs @@ -54,8 +54,14 @@ pub fn map_producer_usage(block: Block) -> Result { #[substreams::handlers::map] pub fn map_schedule_change(block: Block) -> Result { - let active_schedule: Vec = schedule_to_accounts(block.active_schedule_v2.as_ref().unwrap()); - let pending_schedule: Vec = schedule_to_accounts(block.pending_schedule.as_ref().unwrap().schedule_v2.as_ref().unwrap()); + let active_schedule: Vec = match block.proposer_policy.as_ref() { + Some(proposer_policy) => schedule_to_accounts(proposer_policy.proposer_schedule.as_ref().unwrap()), // New + None => schedule_to_accounts(block.active_schedule_v2.as_ref().unwrap()), // Old + }; + let pending_schedule: Vec = match block.pending_schedule.as_ref() { + Some(pending_schedule) => schedule_to_accounts(pending_schedule.schedule_v2.as_ref().unwrap()), // Old + None => vec![], // New ??? + }; // If there is no pending schedule, then there is no schedule change if pending_schedule.is_empty() { diff --git a/eosmechanics/substreams.yaml b/eosmechanics/substreams.yaml index dd30aab..50518a5 100644 --- a/eosmechanics/substreams.yaml +++ b/eosmechanics/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: eosmechanics - version: v0.3.6 + version: v0.3.7 url: https://github.com/pinax-network/substreams doc: Block Producer Benchmarks