mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 12:27:18 +00:00
5507558678
* Refactor to unify state getters block tests * Add reference tests to Altair and Bellatrix versions ofthe state * Fix function naming convetion * Add state-native/v2/references_test.go and state-native/v3/references_test.go * Gazelle run Co-authored-by: Radosław Kapka <rkapka@wp.pl>
20 lines
482 B
Go
20 lines
482 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 VerifyBeaconStateValidatorAtIndexReadOnlyHandlesNilSlice(t *testing.T, factory getState) {
|
|
st, err := factory()
|
|
require.NoError(t, err)
|
|
|
|
_, err = st.ValidatorAtIndexReadOnly(0)
|
|
assert.Equal(t, state.ErrNilValidatorsInState, err)
|
|
}
|