Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wrap the 'recorded_deadline_info' miner function #322

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions fil_actor_interface/src/builtin/miner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,36 @@ impl State {
.into(),
}
}

/// Returns deadline calculations for the state recorded proving period and deadline.
/// This is out of date if the a miner does not have an active miner cron
pub fn recorded_deadline_info(
&self,
policy: &Policy,
current_epoch: ChainEpoch,
) -> DeadlineInfo {
match self {
State::V8(st) => st
.recorded_deadline_info(&from_policy_v13_to_v9(policy), current_epoch)
.into(),
State::V9(st) => st
.recorded_deadline_info(&from_policy_v13_to_v9(policy), current_epoch)
.into(),
State::V10(st) => st
.recorded_deadline_info(&from_policy_v13_to_v10(policy), current_epoch)
.into(),
State::V11(st) => st
.recorded_deadline_info(&from_policy_v13_to_v11(policy), current_epoch)
.into(),
State::V12(st) => st
.recorded_deadline_info(&from_policy_v13_to_v12(policy), current_epoch)
.into(),
State::V13(st) => st.recorded_deadline_info(policy, current_epoch).into(),
State::V14(st) => st
.recorded_deadline_info(&from_policy_v13_to_v14(policy), current_epoch)
.into(),
}
}
}

/// Static information about miner
Expand Down
Loading