Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed Apr 26, 2024
1 parent b455786 commit 1b60ada
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions consensus/types/src/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2113,17 +2113,15 @@ impl<E: EthSpec> BeaconState<E> {
}

pub fn get_pending_balance_to_withdraw(&self, validator_index: usize) -> Result<u64, Error> {
Ok(self
let mut pending_balance = 0;
for withdrawal in self
.pending_partial_withdrawals()?
.iter()
.filter_map(|withdrawal| {
if withdrawal.index as usize == validator_index {
Some(withdrawal.amount)
} else {
None
}
})
.sum())
.filter(|withdrawal| withdrawal.index as usize == validator_index)
{
pending_balance.safe_add_assign(withdrawal.amount)?;
}
Ok(pending_balance)
}

// ******* Electra mutators *******
Expand Down
2 changes: 1 addition & 1 deletion consensus/types/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl Validator {
}

/// Returns `true` if the validator if fully withdrawable.
///
///
/// Modified in electra.
pub fn is_fully_withdrawable_validator(
&self,
Expand Down

0 comments on commit 1b60ada

Please sign in to comment.