prysm-pulse/beacon-chain/state/testing/getters_validator.go
terencechain d17996f8b0
Update to V4 🚀 (#12134)
* Update V3 from V4

* Fix build v3 -> v4

* Update ssz

* Update beacon_chain.pb.go

* Fix formatter import

* Update update-mockgen.sh comment to v4

* Fix conflicts. Pass build and tests

* Fix test
2023-03-17 18:52:56 +00:00

20 lines
491 B
Go

package testing
import (
"testing"
"github.com/prysmaticlabs/prysm/v4/beacon-chain/state"
"github.com/prysmaticlabs/prysm/v4/testing/assert"
"github.com/prysmaticlabs/prysm/v4/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)
}