mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
format and lint fixes
This commit is contained in:
@@ -227,7 +227,7 @@ pub fn envelope_processing<E: EthSpec>(
|
||||
let payment_index = E::slots_per_epoch()
|
||||
.safe_add(state.slot().as_u64().safe_rem(E::slots_per_epoch())?)?
|
||||
as usize;
|
||||
let mut payment = state
|
||||
let payment = state
|
||||
.builder_pending_payments()?
|
||||
.get(payment_index)
|
||||
.ok_or(EnvelopeProcessingError::BuilderPaymentIndexOutOfBounds(
|
||||
@@ -236,7 +236,7 @@ pub fn envelope_processing<E: EthSpec>(
|
||||
.clone();
|
||||
let amount = payment.withdrawal.amount;
|
||||
if amount > 0 {
|
||||
let exit_queue_epoch = state.compute_exit_epoch_and_update_churn(amount, spec)?;
|
||||
let _exit_queue_epoch = state.compute_exit_epoch_and_update_churn(amount, spec)?;
|
||||
state
|
||||
.builder_pending_withdrawals_mut()?
|
||||
.push(payment.withdrawal)
|
||||
|
||||
@@ -714,9 +714,7 @@ pub fn get_builders_sweep_withdrawals<E: EthSpec>(
|
||||
withdrawal_index.safe_add_assign(1)?;
|
||||
}
|
||||
|
||||
builder_index = builder_index
|
||||
.safe_add(1)?
|
||||
.safe_rem(builders.len() as u64)?;
|
||||
builder_index = builder_index.safe_add(1)?.safe_rem(builders.len() as u64)?;
|
||||
processed_count.safe_add_assign(1)?;
|
||||
}
|
||||
|
||||
@@ -801,7 +799,16 @@ pub fn get_validators_sweep_withdrawals<E: EthSpec>(
|
||||
pub fn get_expected_withdrawals<E: EthSpec>(
|
||||
state: &BeaconState<E>,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<(Withdrawals<E>, Option<usize>, Option<usize>, Option<u64>, u64), BlockProcessingError> {
|
||||
) -> Result<
|
||||
(
|
||||
Withdrawals<E>,
|
||||
Option<usize>,
|
||||
Option<usize>,
|
||||
Option<u64>,
|
||||
u64,
|
||||
),
|
||||
BlockProcessingError,
|
||||
> {
|
||||
let mut withdrawal_index = state.next_withdrawal_index()?;
|
||||
let mut withdrawals = Vec::<Withdrawal>::with_capacity(E::max_withdrawals_per_payload());
|
||||
|
||||
|
||||
@@ -551,10 +551,10 @@ fn process_builder_pending_payments<E: EthSpec>(
|
||||
.try_for_each(|payment| -> Result<(), Error> {
|
||||
let exit_queue_epoch =
|
||||
state.compute_exit_epoch_and_update_churn(payment.withdrawal.amount, spec)?;
|
||||
let withdrawable_epoch =
|
||||
let _withdrawable_epoch =
|
||||
exit_queue_epoch.safe_add(spec.min_validator_withdrawability_delay)?;
|
||||
|
||||
let mut withdrawal = payment.withdrawal.clone();
|
||||
let withdrawal = payment.withdrawal.clone();
|
||||
state.builder_pending_withdrawals_mut()?.push(withdrawal)?;
|
||||
Ok(())
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user