From 525db6288d7f265fdbfb3a932049e8f2dbc5ed39 Mon Sep 17 00:00:00 2001 From: NC <17676176+ensi321@users.noreply.github.com> Date: Mon, 9 Dec 2024 10:48:43 -0800 Subject: [PATCH] lint --- .../src/block/processConsolidationRequest.ts | 7 ++----- packages/state-transition/src/block/processWithdrawals.ts | 4 +++- .../src/epoch/processPendingConsolidations.ts | 5 ++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/state-transition/src/block/processConsolidationRequest.ts b/packages/state-transition/src/block/processConsolidationRequest.ts index c11f17e7eaf..8d3cfdc062c 100644 --- a/packages/state-transition/src/block/processConsolidationRequest.ts +++ b/packages/state-transition/src/block/processConsolidationRequest.ts @@ -3,7 +3,7 @@ import {electra, ssz} from "@lodestar/types"; import {CachedBeaconStateElectra} from "../types.js"; import {hasEth1WithdrawalCredential} from "../util/capella.js"; -import {hasCompoundingWithdrawalCredential, hasExecutionWithdrawalCredential, isPubkeyKnown, switchToCompoundingValidator} from "../util/electra.js"; +import {hasCompoundingWithdrawalCredential, isPubkeyKnown, switchToCompoundingValidator} from "../util/electra.js"; import {computeConsolidationEpochAndUpdateChurn} from "../util/epoch.js"; import {getConsolidationChurnLimit, getPendingBalanceToWithdraw, isActiveValidator} from "../util/validator.js"; @@ -50,9 +50,7 @@ export function processConsolidationRequest( const currentEpoch = state.epochCtx.epoch; // Verify that target has compounding withdrawal credentials - if ( - !hasCompoundingWithdrawalCredential(targetValidator.withdrawalCredentials) - ) { + if (!hasCompoundingWithdrawalCredential(targetValidator.withdrawalCredentials)) { return; } @@ -90,7 +88,6 @@ export function processConsolidationRequest( targetIndex, }); state.pendingConsolidations.push(pendingConsolidation); - } /** diff --git a/packages/state-transition/src/block/processWithdrawals.ts b/packages/state-transition/src/block/processWithdrawals.ts index 9d458cff706..d3d3a5d58d9 100644 --- a/packages/state-transition/src/block/processWithdrawals.ts +++ b/packages/state-transition/src/block/processWithdrawals.ts @@ -130,7 +130,9 @@ export function getExpectedWithdrawals( validator.effectiveBalance >= MIN_ACTIVATION_BALANCE && balances.get(withdrawal.validatorIndex) > MIN_ACTIVATION_BALANCE ) { - const balanceOverMinActivationBalance = BigInt(balances.get(withdrawal.validatorIndex) - MIN_ACTIVATION_BALANCE); + const balanceOverMinActivationBalance = BigInt( + balances.get(withdrawal.validatorIndex) - MIN_ACTIVATION_BALANCE + ); const withdrawableBalance = balanceOverMinActivationBalance < withdrawal.amount ? balanceOverMinActivationBalance : withdrawal.amount; withdrawals.push({ diff --git a/packages/state-transition/src/epoch/processPendingConsolidations.ts b/packages/state-transition/src/epoch/processPendingConsolidations.ts index fe0adbdbc34..f9afc7fb122 100644 --- a/packages/state-transition/src/epoch/processPendingConsolidations.ts +++ b/packages/state-transition/src/epoch/processPendingConsolidations.ts @@ -34,7 +34,10 @@ export function processPendingConsolidations(state: CachedBeaconStateElectra, ca break; } // Move active balance to target. Excess balance is withdrawable. - const sourceEffectiveBalance = Math.min(state.balances.get(sourceIndex), state.validators.getReadonly(sourceIndex).effectiveBalance); + const sourceEffectiveBalance = Math.min( + state.balances.get(sourceIndex), + state.validators.getReadonly(sourceIndex).effectiveBalance + ); decreaseBalance(state, sourceIndex, sourceEffectiveBalance); increaseBalance(state, targetIndex, sourceEffectiveBalance); if (cachedBalances) {