use crate::shim::actors::power::State;
use crate::shim::clock::ChainEpoch;
pub trait PowerStateExt {
fn ramp_start_epoch(&self) -> ChainEpoch;
fn ramp_duration_epochs(&self) -> u64;
}
impl PowerStateExt for State {
fn ramp_start_epoch(&self) -> ChainEpoch {
match self {
State::V15(st) => st.ramp_start_epoch,
State::V16(st) => st.ramp_start_epoch,
State::V17(st) => st.ramp_start_epoch,
State::V18(st) => st.ramp_start_epoch,
_ => 0,
}
}
fn ramp_duration_epochs(&self) -> u64 {
match self {
State::V15(st) => st.ramp_duration_epochs,
State::V16(st) => st.ramp_duration_epochs,
State::V17(st) => st.ramp_duration_epochs,
State::V18(st) => st.ramp_duration_epochs,
_ => 0,
}
}
}