Skip to content

Commit

Permalink
Reduce Bigint to Number conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Jan 23, 2025
1 parent f0a3f53 commit 7d9876b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/state-transition/src/block/processWithdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ export function getExpectedWithdrawals(
}

function getPartiallyWithdrawnBalance(withdrawals: capella.Withdrawal[], validatorIndex: ValidatorIndex): number {
let total = 0;
let total = BigInt(0);
for (const withdrawal of withdrawals) {
if (withdrawal.validatorIndex === validatorIndex) {
total += Number(withdrawal.amount);
total += withdrawal.amount;
}
}
return total;
return Number(total);
}

0 comments on commit 7d9876b

Please sign in to comment.