mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 07:58:22 -05:00
27 lines
963 B
Go
27 lines
963 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 := ðpb.AttesterSlashingElectra{}
|
|
if err := as.UnmarshalSSZ(asSSZ); err != nil {
|
|
return nil, err
|
|
}
|
|
b := util.NewBeaconBlockElectra()
|
|
b.Block.Body = ðpb.BeaconBlockBodyElectra{AttesterSlashings: []*ethpb.AttesterSlashingElectra{as}}
|
|
return blocks.NewSignedBeaconBlock(b)
|
|
}
|
|
|
|
func RunAttesterSlashingTest(t *testing.T, config string) {
|
|
common.RunAttesterSlashingTest(t, config, version.String(version.Fulu), blockWithAttesterSlashing, sszToState)
|
|
}
|