mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-15 14:38:20 +00:00
1835f54197
* Refactor for DRY state getters_validator_test and getters_test * Add BUILD.bazel to beacon-chain/state/testing * Handle type assertion error in beacon-chain/state tests * Fix with gazelle Co-authored-by: Nishant Das <nishdas93@gmail.com>
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package v2
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/prysmaticlabs/prysm/beacon-chain/state"
|
|
testtmpl "github.com/prysmaticlabs/prysm/beacon-chain/state/testing"
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
|
)
|
|
|
|
func TestBeaconState_SlotDataRace(t *testing.T) {
|
|
testtmpl.VerifyBeaconState_SlotDataRace(t, func() (state.BeaconState, error) {
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{Slot: 1})
|
|
})
|
|
}
|
|
|
|
func TestBeaconState_MatchCurrentJustifiedCheckpt(t *testing.T) {
|
|
testtmpl.VerifyBeaconState_MatchCurrentJustifiedCheckptNative(
|
|
t,
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{CurrentJustifiedCheckpoint: cp})
|
|
},
|
|
)
|
|
}
|
|
|
|
func TestBeaconState_MatchPreviousJustifiedCheckpt(t *testing.T) {
|
|
testtmpl.VerifyBeaconState_MatchPreviousJustifiedCheckptNative(
|
|
t,
|
|
func(cp *ethpb.Checkpoint) (state.BeaconState, error) {
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{PreviousJustifiedCheckpoint: cp})
|
|
},
|
|
)
|
|
}
|
|
|
|
func TestBeaconState_ValidatorByPubkey(t *testing.T) {
|
|
testtmpl.VerifyBeaconState_ValidatorByPubkey(t, func() (state.BeaconState, error) {
|
|
return InitializeFromProto(ðpb.BeaconStateAltair{})
|
|
})
|
|
}
|