2022-01-13 11:23:53 +00:00
|
|
|
package v1
|
|
|
|
|
|
|
|
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.BeaconState{Slot: 1})
|
|
|
|
})
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBeaconState_MatchCurrentJustifiedCheckpt(t *testing.T) {
|
2022-02-11 06:48:29 +00:00
|
|
|
testtmpl.VerifyBeaconState_MatchCurrentJustifiedCheckptNative(
|
|
|
|
t,
|
|
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconState{CurrentJustifiedCheckpoint: cp})
|
|
|
|
},
|
|
|
|
)
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBeaconState_MatchPreviousJustifiedCheckpt(t *testing.T) {
|
2022-02-11 06:48:29 +00:00
|
|
|
testtmpl.VerifyBeaconState_MatchPreviousJustifiedCheckptNative(
|
|
|
|
t,
|
|
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconState{PreviousJustifiedCheckpoint: cp})
|
|
|
|
},
|
|
|
|
)
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestBeaconState_ValidatorByPubkey(t *testing.T) {
|
2022-02-11 06:48:29 +00:00
|
|
|
testtmpl.VerifyBeaconState_ValidatorByPubkey(t, func() (state.BeaconState, error) {
|
|
|
|
return InitializeFromProto(ðpb.BeaconState{})
|
|
|
|
})
|
2022-01-13 11:23:53 +00:00
|
|
|
}
|