package state_native_test import ( "testing" "github.com/prysmaticlabs/prysm/beacon-chain/state" statenative "github.com/prysmaticlabs/prysm/beacon-chain/state/state-native" testtmpl "github.com/prysmaticlabs/prysm/beacon-chain/state/testing" ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1" ) func TestBeaconState_ValidatorAtIndexReadOnly_HandlesNilSlice_Phase0(t *testing.T) { testtmpl.VerifyBeaconStateValidatorAtIndexReadOnlyHandlesNilSlice(t, func() (state.BeaconState, error) { return statenative.InitializeFromProtoUnsafePhase0(ðpb.BeaconState{ Validators: nil, }) }) } func TestBeaconState_ValidatorAtIndexReadOnly_HandlesNilSlice_Altair(t *testing.T) { testtmpl.VerifyBeaconStateValidatorAtIndexReadOnlyHandlesNilSlice(t, func() (state.BeaconState, error) { return statenative.InitializeFromProtoUnsafeAltair(ðpb.BeaconStateAltair{ Validators: nil, }) }) } func TestBeaconState_ValidatorAtIndexReadOnly_HandlesNilSlice_Bellatrix(t *testing.T) { testtmpl.VerifyBeaconStateValidatorAtIndexReadOnlyHandlesNilSlice(t, func() (state.BeaconState, error) { return statenative.InitializeFromProtoUnsafeBellatrix(ðpb.BeaconStateBellatrix{ Validators: nil, }) }) }