12 const std::shared_ptr<const ScheduleNode> &ancestor,
14 : current_block(block), parent(ancestor) {
15 BOOST_ASSERT(ancestor !=
nullptr);
21 auto fake_parent = std::make_shared<ScheduleNode>(
ScheduleNode());
22 auto node = std::make_shared<ScheduleNode>(fake_parent, block);
28 if (
auto scheduled_change = boost::get<ScheduledChange>(&
action);
29 finalized && scheduled_change !=
nullptr) {
34 }
else if (
auto pause = boost::get<Pause>(&
action);
35 finalized && pause !=
nullptr) {
40 }
else if (
auto forced_change = boost::get<ForcedChange>(&
action);
41 forced_change !=
nullptr) {
42 if (forced_change->delay_start + forced_change->delay_length
47 }
else if (
auto resume = boost::get<Resume>(&
action); resume !=
nullptr) {
59 std::make_shared<ScheduleNode>(shared_from_this(), target_block);
63 node->adjust(finalized);
std::shared_ptr< const primitives::AuthoritySet > current_authorities
const primitives::BlockInfo current_block
std::shared_ptr< ScheduleNode > makeDescendant(const primitives::BlockInfo &block, IsBlockFinalized finalized) const
static std::shared_ptr< ScheduleNode > createAsRoot(std::shared_ptr< const primitives::AuthoritySet > current_authorities, primitives::BlockInfo block)
void adjust(IsBlockFinalized finalized)
boost::variant< NoAction, ScheduledChange, ForcedChange, Pause, Resume > action