Skip to content

Commit

Permalink
Variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ensi321 committed Aug 2, 2024
1 parent 3cf5b52 commit 91c6924
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/beacon-node/src/chain/opPools/opPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export class OpPool {

const endAttesterSlashings = stepsMetrics?.startTimer();
const attesterSlashings: AttesterSlashing[] = [];
const maxAttesterSlashing = stateFork >= ForkSeq.electra ? MAX_ATTESTER_SLASHINGS_ELECTRA : MAX_ATTESTER_SLASHINGS;
const maxAttesterSlashings = stateFork >= ForkSeq.electra ? MAX_ATTESTER_SLASHINGS_ELECTRA : MAX_ATTESTER_SLASHINGS;
attesterSlashing: for (const attesterSlashing of this.attesterSlashings.values()) {
/** Indices slashable in this attester slashing */
const slashableIndices = new Set<ValidatorIndex>();
Expand All @@ -224,7 +224,7 @@ export class OpPool {
if (isSlashableAtEpoch(validator, stateEpoch)) {
slashableIndices.add(index);
}
if (attesterSlashings.length >= maxAttesterSlashing) {
if (attesterSlashings.length >= maxAttesterSlashings) {
break attesterSlashing;
}
}
Expand Down
14 changes: 7 additions & 7 deletions packages/state-transition/src/util/electra.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ export function isFullyWithdrawableValidator(
balance: number,
epoch: number
): boolean {
const {withdrawableEpoch, withdrawalCredentials: withdrawalCredential} = validatorCredential;
const {withdrawableEpoch, withdrawalCredentials} = validatorCredential;

if (fork < ForkSeq.capella) {
throw new Error(`isFullyWithdrawableValidator not supported at forkSeq=${fork} < ForkSeq.capella`);
}
const hasWithdrawableCredentials =
fork >= ForkSeq.electra
? hasExecutionWithdrawalCredential(withdrawalCredential)
: hasEth1WithdrawalCredential(withdrawalCredential);
? hasExecutionWithdrawalCredential(withdrawalCredentials)
: hasEth1WithdrawalCredential(withdrawalCredentials);

return hasWithdrawableCredentials && withdrawableEpoch <= epoch && balance > 0;
}
Expand All @@ -46,18 +46,18 @@ export function isPartiallyWithdrawableValidator(
validatorCredential: ValidatorInfo,
balance: number
): boolean {
const {effectiveBalance, withdrawalCredentials: withdrawalCredential} = validatorCredential;
const {effectiveBalance, withdrawalCredentials} = validatorCredential;

if (fork < ForkSeq.capella) {
throw new Error(`isPartiallyWithdrawableValidator not supported at forkSeq=${fork} < ForkSeq.capella`);
}
const hasWithdrawableCredentials =
fork >= ForkSeq.electra
? hasExecutionWithdrawalCredential(withdrawalCredential)
: hasEth1WithdrawalCredential(withdrawalCredential);
? hasExecutionWithdrawalCredential(withdrawalCredentials)
: hasEth1WithdrawalCredential(withdrawalCredentials);

const validatorMaxEffectiveBalance =
fork >= ForkSeq.electra ? getValidatorMaxEffectiveBalance(withdrawalCredential) : MAX_EFFECTIVE_BALANCE;
fork >= ForkSeq.electra ? getValidatorMaxEffectiveBalance(withdrawalCredentials) : MAX_EFFECTIVE_BALANCE;
const hasMaxEffectiveBalance = effectiveBalance === validatorMaxEffectiveBalance;
const hasExcessBalance = balance > validatorMaxEffectiveBalance;

Expand Down

0 comments on commit 91c6924

Please sign in to comment.