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-02-11 06:48:29 +00:00
|
|
|
testtmpl.VerifyBeaconState_SlotDataRace(t, func() (state.BeaconState, error) {
|
|
|
|
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) {
|
|
|
|
testtmpl.VerifyBeaconState_MatchCurrentJustifiedCheckptNative(
|
|
|
|
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) {
|
|
|
|
testtmpl.VerifyBeaconState_MatchPreviousJustifiedCheckptNative(
|
|
|
|
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) {
|
|
|
|
testtmpl.VerifyBeaconState_ValidatorByPubkey(t, func() (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{})
|
|
|
|
})
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|