[][src]Struct types::beacon_block::BeaconBlock

pub struct BeaconBlock<T: EthSpec> {
    pub slot: Slot,
    pub parent_root: Hash256,
    pub state_root: Hash256,
    pub body: BeaconBlockBody<T>,
    pub signature: Signature,
}

A block of the BeaconChain.

Spec v0.8.0

Fields

slot: Slotparent_root: Hash256state_root: Hash256body: BeaconBlockBody<T>signature: Signature

Methods

impl<T: EthSpec> BeaconBlock<T>[src]

pub fn empty(spec: &ChainSpec) -> Self[src]

Returns an empty block to be used during genesis.

Spec v0.8.1

pub fn epoch(&self) -> Epoch[src]

Returns the epoch corresponding to self.slot.

pub fn canonical_root(&self) -> Hash256[src]

Returns the signed_root of the block.

Spec v0.8.1

pub fn block_header(&self) -> BeaconBlockHeader[src]

Returns a full BeaconBlockHeader of this block.

Note: This method is used instead of an Into impl to avoid a Clone of an entire block when you want to have the block and the header.

Note: performs a full tree-hash of self.body.

Spec v0.8.1

pub fn temporary_block_header(&self) -> BeaconBlockHeader[src]

Returns a "temporary" header, where the state_root is Hash256::zero().

Spec v0.8.0

Trait Implementations

impl<T: EthSpec> TestRandom for BeaconBlock<T>[src]

impl<T: Clone + EthSpec> Clone for BeaconBlock<T>[src]

impl<T: PartialEq + EthSpec> PartialEq<BeaconBlock<T>> for BeaconBlock<T>[src]

impl<T: Debug + EthSpec> Debug for BeaconBlock<T>[src]

impl<T: EthSpec> SignedRoot for BeaconBlock<T>[src]

impl<T: EthSpec> TreeHash for BeaconBlock<T>[src]

impl<T: EthSpec> Serialize for BeaconBlock<T> where
    T: EthSpec
[src]

impl<'de, T: EthSpec> Deserialize<'de> for BeaconBlock<T> where
    T: EthSpec
[src]

impl<T: EthSpec> Decode for BeaconBlock<T>[src]

impl<T: EthSpec> Encode for BeaconBlock<T>[src]

Auto Trait Implementations

impl<T> Send for BeaconBlock<T> where
    <T as EthSpec>::MaxAttestations: Send,
    <T as EthSpec>::MaxAttesterSlashings: Send,
    <T as EthSpec>::MaxDeposits: Send,
    <T as EthSpec>::MaxProposerSlashings: Send,
    <T as EthSpec>::MaxTransfers: Send,
    <T as EthSpec>::MaxValidatorsPerCommittee: Send,
    <T as EthSpec>::MaxVoluntaryExits: Send

impl<T> Unpin for BeaconBlock<T> where
    <T as EthSpec>::MaxAttestations: Unpin,
    <T as EthSpec>::MaxAttesterSlashings: Unpin,
    <T as EthSpec>::MaxDeposits: Unpin,
    <T as EthSpec>::MaxProposerSlashings: Unpin,
    <T as EthSpec>::MaxTransfers: Unpin,
    <T as EthSpec>::MaxValidatorsPerCommittee: Unpin,
    <T as EthSpec>::MaxVoluntaryExits: Unpin

impl<T> Sync for BeaconBlock<T> where
    <T as EthSpec>::MaxAttestations: Sync,
    <T as EthSpec>::MaxAttesterSlashings: Sync,
    <T as EthSpec>::MaxDeposits: Sync,
    <T as EthSpec>::MaxProposerSlashings: Sync,
    <T as EthSpec>::MaxTransfers: Sync,
    <T as EthSpec>::MaxValidatorsPerCommittee: Sync,
    <T as EthSpec>::MaxVoluntaryExits: Sync

impl<T> UnwindSafe for BeaconBlock<T> where
    <T as EthSpec>::MaxAttestations: UnwindSafe,
    <T as EthSpec>::MaxAttesterSlashings: UnwindSafe,
    <T as EthSpec>::MaxDeposits: UnwindSafe,
    <T as EthSpec>::MaxProposerSlashings: UnwindSafe,
    <T as EthSpec>::MaxTransfers: UnwindSafe,
    <T as EthSpec>::MaxValidatorsPerCommittee: UnwindSafe,
    <T as EthSpec>::MaxVoluntaryExits: UnwindSafe

impl<T> RefUnwindSafe for BeaconBlock<T> where
    <T as EthSpec>::MaxAttestations: RefUnwindSafe,
    <T as EthSpec>::MaxAttesterSlashings: RefUnwindSafe,
    <T as EthSpec>::MaxDeposits: RefUnwindSafe,
    <T as EthSpec>::MaxProposerSlashings: RefUnwindSafe,
    <T as EthSpec>::MaxTransfers: RefUnwindSafe,
    <T as EthSpec>::MaxValidatorsPerCommittee: RefUnwindSafe,
    <T as EthSpec>::MaxVoluntaryExits: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized