mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 06:28:20 +00:00
35 lines
1.2 KiB
Go
35 lines
1.2 KiB
Go
|
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,
|
||
|
})
|
||
|
})
|
||
|
}
|