2021-05-26 16:19:54 +00:00
|
|
|
package interfaces
|
|
|
|
|
|
|
|
import (
|
2021-07-18 19:32:52 +00:00
|
|
|
ssz "github.com/ferranbt/fastssz"
|
2021-05-26 16:19:54 +00:00
|
|
|
types "github.com/prysmaticlabs/eth2-types"
|
2021-07-21 21:34:07 +00:00
|
|
|
ethpb "github.com/prysmaticlabs/prysm/proto/prysm/v1alpha1"
|
2021-07-18 19:32:52 +00:00
|
|
|
prysmv2 "github.com/prysmaticlabs/prysm/proto/prysm/v2"
|
2021-05-26 16:19:54 +00:00
|
|
|
"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
|
2021-05-27 00:54:06 +00:00
|
|
|
Copy() SignedBeaconBlock
|
2021-05-26 16:19:54 +00:00
|
|
|
Proto() proto.Message
|
|
|
|
PbPhase0Block() (*ethpb.SignedBeaconBlock, error)
|
2021-07-18 19:32:52 +00:00
|
|
|
PbAltairBlock() (*prysmv2.SignedBeaconBlockAltair, error)
|
|
|
|
ssz.Marshaler
|
|
|
|
ssz.Unmarshaler
|
|
|
|
Version() int
|
2021-05-26 16:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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)
|
|
|
|
Proto() proto.Message
|
2021-07-18 19:32:52 +00:00
|
|
|
ssz.Marshaler
|
|
|
|
ssz.Unmarshaler
|
|
|
|
Version() int
|
2021-05-26 16:19:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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
|
2021-07-18 19:32:52 +00:00
|
|
|
SyncAggregate() (*prysmv2.SyncAggregate, error)
|
2021-05-26 16:19:54 +00:00
|
|
|
IsNil() bool
|
|
|
|
HashTreeRoot() ([32]byte, error)
|
|
|
|
Proto() proto.Message
|
|
|
|
}
|