Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Dec 9, 2024
1 parent fe07433 commit 525db62
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -90,7 +88,6 @@ export function processConsolidationRequest(
targetIndex,
});
state.pendingConsolidations.push(pendingConsolidation);

}

/**
Expand Down
4 changes: 3 additions & 1 deletion packages/state-transition/src/block/processWithdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 525db62

Please sign in to comment.