Skip to content

Commit

Permalink
fix: make decrease_balance work (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
syjn99 authored Feb 13, 2025
1 parent a7ab931 commit 8be5158
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/common/consensus/src/deneb/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ impl BeaconState {
/// Decrease the validator balance at index ``index`` by ``delta`` with underflow protection.
pub fn decrease_balance(&mut self, index: u64, delta: u64) {
if let Some(balance) = self.balances.get_mut(index as usize) {
let _ = balance.saturating_sub(delta);
*balance = balance.saturating_sub(delta);
}
}

Expand Down

0 comments on commit 8be5158

Please sign in to comment.