2021-07-26 20:55:30 +00:00
|
|
|
package v2
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2022-02-08 09:30:06 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2021-09-23 18:53:46 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/testing/require"
|
2021-07-26 20:55:30 +00:00
|
|
|
)
|
|
|
|
|
2022-03-15 18:32:09 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2021-07-26 20:55:30 +00:00
|
|
|
func TestBeaconState_CurrentEpochAttestations(t *testing.T) {
|
2022-02-08 09:30:06 +00:00
|
|
|
s, err := InitializeFromProtoUnsafe(ðpb.BeaconStateAltair{})
|
|
|
|
require.NoError(t, err)
|
|
|
|
_, err = s.CurrentEpochAttestations()
|
2021-07-26 20:55:30 +00:00
|
|
|
require.ErrorContains(t, "CurrentEpochAttestations is not supported for hard fork 1 beacon state", err)
|
|
|
|
}
|
|
|
|
|
2022-03-15 18:32:09 +00:00
|
|
|
func TestBeaconState_LatestExecutionPayloadHeader(t *testing.T) {
|
2022-02-08 09:30:06 +00:00
|
|
|
s, err := InitializeFromProtoUnsafe(ðpb.BeaconStateAltair{})
|
|
|
|
require.NoError(t, err)
|
2022-03-15 18:32:09 +00:00
|
|
|
_, err = s.LatestExecutionPayloadHeader()
|
|
|
|
require.ErrorContains(t, "LatestExecutionPayloadHeader is not supported for hard fork 1 beacon state", err)
|
2021-07-26 20:55:30 +00:00
|
|
|
}
|