Files
prysm/testing/spectest/shared/bellatrix/operations/attester_slashing.go
Bastin 92bd211e4d upgrade v6 to v7 (#15989)
* upgrade v6 to v7

* changelog

* update-go-ssz
2025-11-06 16:16:23 +00:00

27 lines
958 B
Go

package operations
import (
"testing"
"github.com/OffchainLabs/prysm/v7/consensus-types/blocks"
"github.com/OffchainLabs/prysm/v7/consensus-types/interfaces"
ethpb "github.com/OffchainLabs/prysm/v7/proto/prysm/v1alpha1"
"github.com/OffchainLabs/prysm/v7/runtime/version"
common "github.com/OffchainLabs/prysm/v7/testing/spectest/shared/common/operations"
"github.com/OffchainLabs/prysm/v7/testing/util"
)
func blockWithAttesterSlashing(asSSZ []byte) (interfaces.SignedBeaconBlock, error) {
as := &ethpb.AttesterSlashing{}
if err := as.UnmarshalSSZ(asSSZ); err != nil {
return nil, err
}
b := util.NewBeaconBlockBellatrix()
b.Block.Body = &ethpb.BeaconBlockBodyBellatrix{AttesterSlashings: []*ethpb.AttesterSlashing{as}}
return blocks.NewSignedBeaconBlock(b)
}
func RunAttesterSlashingTest(t *testing.T, config string) {
common.RunAttesterSlashingTest(t, config, version.String(version.Bellatrix), blockWithAttesterSlashing, sszToState)
}