mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
5507558678
* 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>
30 lines
1.0 KiB
Go
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(ðpb.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(ðpb.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(ðpb.BeaconStateAltair{})
|
|
require.NoError(t, err)
|
|
_, err = s.LatestExecutionPayloadHeader()
|
|
require.ErrorContains(t, "LatestExecutionPayloadHeader is not supported for hard fork 1 beacon state", err)
|
|
}
|