prysm-pulse/beacon-chain/state/testing/getters_validator.go

20 lines
491 B
Go
Raw Normal View History

package testing
import (
"testing"
"github.com/prysmaticlabs/prysm/v3/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v3/testing/assert"
"github.com/prysmaticlabs/prysm/v3/testing/require"
)
type getState func() (state.BeaconState, error)
func VerifyBeaconStateValidatorAtIndexReadOnlyHandlesNilSlice(t *testing.T, factory getState) {
st, err := factory()
require.NoError(t, err)
_, err = st.ValidatorAtIndexReadOnly(0)
assert.Equal(t, state.ErrNilValidatorsInState, err)
}