prysm-pulse/beacon-chain/state/v2/deprecated_getters_test.go
Leo Lara 5507558678
Some improvements for the state package testing (#10316)
* Refactor to unify state getters block tests

* Add reference tests to Altair and Bellatrix versions ofthe state

* Fix function naming convetion

* Add state-native/v2/references_test.go and state-native/v3/references_test.go

* Gazelle run

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
2022-03-15 18:32:09 +00:00

30 lines
1.0 KiB
Go

package v2
import (
"testing"
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/testing/require"
)
func TestBeaconState_PreviousEpochAttestations(t *testing.T) {
s, err := InitializeFromProtoUnsafe(&ethpb.BeaconStateAltair{})
require.NoError(t, err)
_, err = s.PreviousEpochAttestations()
require.ErrorContains(t, "PreviousEpochAttestations is not supported for hard fork 1 beacon state", err)
}
func TestBeaconState_CurrentEpochAttestations(t *testing.T) {
s, err := InitializeFromProtoUnsafe(&ethpb.BeaconStateAltair{})
require.NoError(t, err)
_, err = s.CurrentEpochAttestations()
require.ErrorContains(t, "CurrentEpochAttestations is not supported for hard fork 1 beacon state", err)
}
func TestBeaconState_LatestExecutionPayloadHeader(t *testing.T) {
s, err := InitializeFromProtoUnsafe(&ethpb.BeaconStateAltair{})
require.NoError(t, err)
_, err = s.LatestExecutionPayloadHeader()
require.ErrorContains(t, "LatestExecutionPayloadHeader is not supported for hard fork 1 beacon state", err)
}