2022-01-13 11:23:53 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-02-11 06:48:29 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
|
|
testtmpl "github.com/prysmaticlabs/prysm/beacon-chain/state/testing"
|
2022-01-13 11:23:53 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBeaconState_SlotDataRace(t *testing.T) {
|
2022-03-15 18:32:09 +00:00
|
|
|
testtmpl.VerifyBeaconStateSlotDataRace(t, func() (state.BeaconState, error) {
|
2022-02-11 06:48:29 +00:00
|
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{Slot: 1})
|
|
|
|
})
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|
|
|
|
|
2022-02-11 06:48:29 +00:00
|
|
|
func TestBeaconState_MatchCurrentJustifiedCheckpt(t *testing.T) {
|
2022-03-15 18:32:09 +00:00
|
|
|
testtmpl.VerifyBeaconStateMatchCurrentJustifiedCheckptNative(
|
2022-02-11 06:48:29 +00:00
|
|
|
t,
|
|
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{CurrentJustifiedCheckpoint: cp})
|
2022-01-13 11:23:53 +00:00
|
|
|
},
|
2022-02-11 06:48:29 +00:00
|
|
|
)
|
|
|
|
}
|
2022-01-13 11:23:53 +00:00
|
|
|
|
2022-02-11 06:48:29 +00:00
|
|
|
func TestBeaconState_MatchPreviousJustifiedCheckpt(t *testing.T) {
|
2022-03-15 18:32:09 +00:00
|
|
|
testtmpl.VerifyBeaconStateMatchPreviousJustifiedCheckptNative(
|
2022-02-11 06:48:29 +00:00
|
|
|
t,
|
|
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{PreviousJustifiedCheckpoint: cp})
|
2022-01-13 11:23:53 +00:00
|
|
|
},
|
2022-02-11 06:48:29 +00:00
|
|
|
)
|
|
|
|
}
|
2022-01-13 11:23:53 +00:00
|
|
|
|
2022-02-11 06:48:29 +00:00
|
|
|
func TestBeaconState_ValidatorByPubkey(t *testing.T) {
|
2022-03-15 18:32:09 +00:00
|
|
|
testtmpl.VerifyBeaconStateValidatorByPubkey(t, func() (state.BeaconState, error) {
|
2022-02-11 06:48:29 +00:00
|
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{})
|
|
|
|
})
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|