Skip to content

Commit

Permalink
fix: work around for sliceFrom() api
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Aug 19, 2024
1 parent 1f75c59 commit 7aa6678
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/state-transition/src/block/processWithdrawals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export function processWithdrawals(

if (fork >= ForkSeq.electra) {
const stateElectra = state as CachedBeaconStateElectra;
// TODO: remove once this PR is included in a release
// https://github.com/ChainSafe/ssz/pull/394
stateElectra.pendingPartialWithdrawals.getAllReadonly();
stateElectra.pendingPartialWithdrawals = stateElectra.pendingPartialWithdrawals.sliceFrom(partialWithdrawalsCount);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export function processPendingBalanceDeposits(state: CachedBeaconStateElectra, c
nextDepositIndex++;
}

// TODO: remove once this PR is included in a release
// https://github.com/ChainSafe/ssz/pull/394
state.pendingBalanceDeposits.getAllReadonly();
const remainingPendingBalanceDeposits = state.pendingBalanceDeposits.sliceFrom(nextDepositIndex);
state.pendingBalanceDeposits = remainingPendingBalanceDeposits;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,8 @@ export function processPendingConsolidations(state: CachedBeaconStateElectra, ca
nextPendingConsolidation++;
}

// TODO: remove once this PR is included in a release
// https://github.com/ChainSafe/ssz/pull/394
state.pendingConsolidations.getAllReadonly();
state.pendingConsolidations = state.pendingConsolidations.sliceFrom(nextPendingConsolidation);
}

0 comments on commit 7aa6678

Please sign in to comment.