forest/shim/actors/builtin/power/
ext.rs1use crate::shim::actors::power::State;
5use crate::shim::clock::ChainEpoch;
6
7pub trait PowerStateExt {
8 fn ramp_start_epoch(&self) -> ChainEpoch;
10 fn ramp_duration_epochs(&self) -> u64;
14}
15
16impl PowerStateExt for State {
17 fn ramp_start_epoch(&self) -> ChainEpoch {
18 match self {
19 State::V15(st) => st.ramp_start_epoch,
20 State::V16(st) => st.ramp_start_epoch,
21 State::V17(st) => st.ramp_start_epoch,
22 _ => 0,
23 }
24 }
25
26 fn ramp_duration_epochs(&self) -> u64 {
27 match self {
28 State::V15(st) => st.ramp_duration_epochs,
29 State::V16(st) => st.ramp_duration_epochs,
30 State::V17(st) => st.ramp_duration_epochs,
31 _ => 0,
32 }
33 }
34}