Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion clients/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1418,7 +1418,8 @@ fn command_list(config: &Config, stake_pool_address: &Pubkey) -> CommandResult {
let cli_stake_pool_stake_account_infos = validator_list
.validators
.iter()
.map(|validator| {
.enumerate()
.map(|(index, validator)| {
let validator_seed = NonZeroU32::new(validator.validator_seed_suffix.into());
let (stake_account_address, _) = find_stake_program_address(
&config.stake_pool_program_id,
Expand All @@ -1434,6 +1435,7 @@ fn command_list(config: &Config, stake_pool_address: &Pubkey) -> CommandResult {
);
let update_required = u64::from(validator.last_update_epoch) != epoch_info.epoch;
CliStakePoolStakeAccountInfo {
index,
vote_account_address: validator.vote_account_address.to_string(),
stake_account_address: stake_account_address.to_string(),
validator_active_stake_lamports: validator.active_stake_lamports.into(),
Expand Down
4 changes: 3 additions & 1 deletion clients/cli/src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ impl VerboseDisplay for CliStakePoolDetails {
for stake_account in &self.stake_accounts {
writeln!(
w,
"Vote Account: {}\tStake Account: {}\tActive Balance: {}\tTransient Stake Account: {}\tTransient Balance: {}\tLast Update Epoch: {}{}",
"Index: {}\tVote Account: {}\tStake Account: {}\tActive Balance: {}\tTransient Stake Account: {}\tTransient Balance: {}\tLast Update Epoch: {}{}",
stake_account.index,
stake_account.vote_account_address,
stake_account.stake_account_address,
Sol(stake_account.validator_active_stake_lamports),
Expand Down Expand Up @@ -347,6 +348,7 @@ impl VerboseDisplay for CliStakePoolDetails {
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct CliStakePoolStakeAccountInfo {
pub index: usize,
pub vote_account_address: String,
pub stake_account_address: String,
pub validator_active_stake_lamports: u64,
Expand Down
Loading