prysm-pulse/proto/interfaces/block_interface.go
terence tsao 1d3a9983cc
Move block interface next to generated pb (#9146)
* Move block interface next to pb

* Update fuzz build bazel

* Move interface to /proto/interface and wrapper next to generated pb

* Fix fuzz build bazel

* Add //proto/eth/v1alpha1/wrapper

Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-07-06 15:34:05 +00:00

50 lines
1.3 KiB
Go

package interfaces
import (
types "github.com/prysmaticlabs/eth2-types"
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
"google.golang.org/protobuf/proto"
)
// SignedBeaconBlock is an interface describing the method set of
// a signed beacon block.
type SignedBeaconBlock interface {
Block() BeaconBlock
Signature() []byte
IsNil() bool
Copy() SignedBeaconBlock
MarshalSSZ() ([]byte, error)
Proto() proto.Message
PbPhase0Block() (*ethpb.SignedBeaconBlock, error)
}
// BeaconBlock describes an interface which states the methods
// employed by an object that is a beacon block.
type BeaconBlock interface {
Slot() types.Slot
ProposerIndex() types.ValidatorIndex
ParentRoot() []byte
StateRoot() []byte
Body() BeaconBlockBody
IsNil() bool
HashTreeRoot() ([32]byte, error)
MarshalSSZ() ([]byte, error)
Proto() proto.Message
}
// BeaconBlockBody describes the method set employed by an object
// that is a beacon block body.
type BeaconBlockBody interface {
RandaoReveal() []byte
Eth1Data() *ethpb.Eth1Data
Graffiti() []byte
ProposerSlashings() []*ethpb.ProposerSlashing
AttesterSlashings() []*ethpb.AttesterSlashing
Attestations() []*ethpb.Attestation
Deposits() []*ethpb.Deposit
VoluntaryExits() []*ethpb.SignedVoluntaryExit
IsNil() bool
HashTreeRoot() ([32]byte, error)
Proto() proto.Message
}