Skip to content

Commit 1b60ada

Browse files
committed
lint
1 parent b455786 commit 1b60ada

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

consensus/types/src/beacon_state.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,17 +2113,15 @@ impl<E: EthSpec> BeaconState<E> {
21132113
}
21142114

21152115
pub fn get_pending_balance_to_withdraw(&self, validator_index: usize) -> Result<u64, Error> {
2116-
Ok(self
2116+
let mut pending_balance = 0;
2117+
for withdrawal in self
21172118
.pending_partial_withdrawals()?
21182119
.iter()
2119-
.filter_map(|withdrawal| {
2120-
if withdrawal.index as usize == validator_index {
2121-
Some(withdrawal.amount)
2122-
} else {
2123-
None
2124-
}
2125-
})
2126-
.sum())
2120+
.filter(|withdrawal| withdrawal.index as usize == validator_index)
2121+
{
2122+
pending_balance.safe_add_assign(withdrawal.amount)?;
2123+
}
2124+
Ok(pending_balance)
21272125
}
21282126

21292127
// ******* Electra mutators *******

consensus/types/src/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl Validator {
153153
}
154154

155155
/// Returns `true` if the validator if fully withdrawable.
156-
///
156+
///
157157
/// Modified in electra.
158158
pub fn is_fully_withdrawable_validator(
159159
&self,

0 commit comments

Comments
 (0)