mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
* Electra: Beacon State * Electra: Beacon state fixes from PR 13919 * Add missing tests - part 1 * Split eip_7251_root.go into different files and reuse/share code with historical state summaries root. It's identical! * Add missing tests - part 2 * deposit receipts start index getters and setters (#13947) * adding in getters and setters for deposit receipts start index * adding tests * gaz * Add missing tests - part 3 of 3 Update the electra withdrawal example with a ssz state containing pending partial withdrawals * add tests for beacon-chain/state/state-native/getters_balance_deposits.go * Add electra field to testing/util/block.go execution payload * godoc commentary on public methods * Fix failing test * Add balances index out of bounds check and relevant tests. * Revert switch case electra * Instead of copying spectest data into testdata, use the spectest dependency * Deepsource fixes * Address @rkapka PR feedback * s/MaxPendingPartialsPerWithdrawalSweep/MaxPendingPartialsPerWithdrawalsSweep/ * Use multivalue slice compatible accessors for validator and balance in ActiveBalanceAtIndex * More @rkapka feedback. What a great reviewer! * More tests for branching logic in ExitEpochAndUpdateChurn * fix build --------- Co-authored-by: james-prysm <90280386+james-prysm@users.noreply.github.com>
28 lines
980 B
Go
28 lines
980 B
Go
package state_native_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
|
|
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
|
"github.com/prysmaticlabs/prysm/v5/testing/require"
|
|
"github.com/prysmaticlabs/prysm/v5/testing/util"
|
|
)
|
|
|
|
func TestSetDepositReceiptsStartIndex(t *testing.T) {
|
|
t.Run("previous fork returns expected error", func(t *testing.T) {
|
|
dState, _ := util.DeterministicGenesisState(t, 1)
|
|
require.ErrorContains(t, "is not supported", dState.SetDepositReceiptsStartIndex(1))
|
|
})
|
|
t.Run("electra sets expected value", func(t *testing.T) {
|
|
old := uint64(2)
|
|
dState, err := state_native.InitializeFromProtoElectra(ðpb.BeaconStateElectra{DepositReceiptsStartIndex: old})
|
|
require.NoError(t, err)
|
|
want := uint64(3)
|
|
require.NoError(t, dState.SetDepositReceiptsStartIndex(want))
|
|
got, err := dState.DepositReceiptsStartIndex()
|
|
require.NoError(t, err)
|
|
require.Equal(t, want, got)
|
|
})
|
|
}
|