github.com/prysmaticlabs/prysm@v1.4.4/proto/interfaces/block_interface.go (about)

     1  package interfaces
     2  
     3  import (
     4  	types "github.com/prysmaticlabs/eth2-types"
     5  	ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
     6  	"google.golang.org/protobuf/proto"
     7  )
     8  
     9  // SignedBeaconBlock is an interface describing the method set of
    10  // a signed beacon block.
    11  type SignedBeaconBlock interface {
    12  	Block() BeaconBlock
    13  	Signature() []byte
    14  	IsNil() bool
    15  	Copy() SignedBeaconBlock
    16  	MarshalSSZ() ([]byte, error)
    17  	Proto() proto.Message
    18  	PbPhase0Block() (*ethpb.SignedBeaconBlock, error)
    19  }
    20  
    21  // BeaconBlock describes an interface which states the methods
    22  // employed by an object that is a beacon block.
    23  type BeaconBlock interface {
    24  	Slot() types.Slot
    25  	ProposerIndex() types.ValidatorIndex
    26  	ParentRoot() []byte
    27  	StateRoot() []byte
    28  	Body() BeaconBlockBody
    29  	IsNil() bool
    30  	HashTreeRoot() ([32]byte, error)
    31  	MarshalSSZ() ([]byte, error)
    32  	Proto() proto.Message
    33  }
    34  
    35  // BeaconBlockBody describes the method set employed by an object
    36  // that is a beacon block body.
    37  type BeaconBlockBody interface {
    38  	RandaoReveal() []byte
    39  	Eth1Data() *ethpb.Eth1Data
    40  	Graffiti() []byte
    41  	ProposerSlashings() []*ethpb.ProposerSlashing
    42  	AttesterSlashings() []*ethpb.AttesterSlashing
    43  	Attestations() []*ethpb.Attestation
    44  	Deposits() []*ethpb.Deposit
    45  	VoluntaryExits() []*ethpb.SignedVoluntaryExit
    46  	IsNil() bool
    47  	HashTreeRoot() ([32]byte, error)
    48  	Proto() proto.Message
    49  }