Skip to content

Commit

Permalink
Add 'Validators by stake level' line to epoch summary
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 3, 2021
1 parent 8d1f93a commit f65c3ce
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bot/src/stake_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl GenericStakePool for StakePoolOMatic {
desired_validator_stake: &[ValidatorStake],
) -> Result<(EpochStakeNotes, ValidatorStakeActions), Box<dyn error::Error>> {
let mut validator_stake_actions = HashMap::default();
let mut no_stake_node_count = 0;
let mut bonus_stake_node_count = 0;
let mut baseline_stake_node_count = 0;

Expand All @@ -175,7 +176,7 @@ impl GenericStakePool for StakePoolOMatic {
match stake_state {
ValidatorStakeState::Bonus => bonus_stake_node_count += 1,
ValidatorStakeState::Baseline => baseline_stake_node_count += 1,
ValidatorStakeState::None => (),
ValidatorStakeState::None => no_stake_node_count += 1,
}
}

Expand Down Expand Up @@ -288,6 +289,10 @@ impl GenericStakePool for StakePoolOMatic {
),
format!("Baseline stake amount: {}", Sol(self.baseline_stake_amount)),
format!("Bonus stake amount: {}", Sol(bonus_stake_amount)),
format!(
"Validators by stake level: None={}, Baseline={}, Bonus={}",
no_stake_node_count, baseline_stake_node_count, bonus_stake_node_count
),
];

let busy_validators = validator_stake_actions
Expand Down
4 changes: 4 additions & 0 deletions bot/src/stake_pool_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ impl GenericStakePool for StakePool {
),
format!("Baseline stake amount: {}", Sol(self.baseline_stake_amount)),
format!("Bonus stake amount: {}", Sol(bonus_stake_amount)),
format!(
"Validators by stake level: None={}, Baseline={}, Bonus={}",
min_stake_node_count, baseline_stake_node_count, bonus_stake_node_count
),
];

let busy_validators = validator_stake_actions
Expand Down

0 comments on commit f65c3ce

Please sign in to comment.