mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-10 11:41:21 +00:00
20 lines
484 B
Go
20 lines
484 B
Go
|
package testing
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
||
|
"github.com/prysmaticlabs/prysm/testing/assert"
|
||
|
"github.com/prysmaticlabs/prysm/testing/require"
|
||
|
)
|
||
|
|
||
|
type getState func() (state.BeaconState, error)
|
||
|
|
||
|
func VerifyBeaconState_ValidatorAtIndexReadOnly_HandlesNilSlice(t *testing.T, factory getState) {
|
||
|
st, err := factory()
|
||
|
require.NoError(t, err)
|
||
|
|
||
|
_, err = st.ValidatorAtIndexReadOnly(0)
|
||
|
assert.Equal(t, state.ErrNilValidatorsInState, err)
|
||
|
}
|