mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-17 23:38:46 +00:00
412ddbb29e
* Introduce changes from Altair hf1 branch * go pkg viz changes * Fix test * goimports for some reason * Use a more safe method of wrapping validators with regards to nil validators. Add basic tests for this wrapped validator * Use a more safe method of wrapping validators with regards to nil validators. Add basic tests for this wrapped validator * Panic fixes * Fix tests * remove nil validator test as it is no longer possible * goimports for some reason Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
21 lines
550 B
Go
21 lines
550 B
Go
package v1_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
v1 "github.com/prysmaticlabs/prysm/beacon-chain/state/v1"
|
|
pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/v1"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/assert"
|
|
"github.com/prysmaticlabs/prysm/shared/testutil/require"
|
|
)
|
|
|
|
func TestBeaconState_ValidatorAtIndexReadOnly_HandlesNilSlice(t *testing.T) {
|
|
st, err := v1.InitializeFromProtoUnsafe(&pb.BeaconState{
|
|
Validators: nil,
|
|
})
|
|
require.NoError(t, err)
|
|
|
|
_, err = st.ValidatorAtIndexReadOnly(0)
|
|
assert.Equal(t, v1.ErrNilValidatorsInState, err)
|
|
}
|