pub struct PreparedBlock {
pub block: Block,
pub block_blob: Vec<u8>,
pub hf_vote: HardFork,
pub hf_version: HardFork,
pub block_hash: [u8; 32],
pub pow_hash: [u8; 32],
pub miner_tx_weight: usize,
}Expand description
A pre-prepared block with all data needed to verify it.
Fields§
§block: BlockThe block
block_blob: Vec<u8>The serialised block’s bytes
hf_vote: HardForkThe block’s hf vote
hf_version: HardForkThe block’s hf version
block_hash: [u8; 32]The block’s hash
pow_hash: [u8; 32]The block’s POW hash.
miner_tx_weight: usizeThe weight of the block’s miner transaction.
Implementations§
Source§impl PreparedBlock
impl PreparedBlock
Sourcepub fn new<R: RandomX>(
block: Block,
randomx_vm: Option<&R>,
) -> Result<Self, ConsensusError>
pub fn new<R: RandomX>( block: Block, randomx_vm: Option<&R>, ) -> Result<Self, ConsensusError>
Creates a new PreparedBlock.
The randomX VM must be Some if RX is needed or this will panic. The randomX VM must also be initialised with the correct seed.
Sourcepub fn new_alt_block(block: AltBlockInformation) -> Result<Self, ConsensusError>
pub fn new_alt_block(block: AltBlockInformation) -> Result<Self, ConsensusError>
Creates a new PreparedBlock from an AltBlockInformation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PreparedBlock
impl RefUnwindSafe for PreparedBlock
impl Send for PreparedBlock
impl Sync for PreparedBlock
impl Unpin for PreparedBlock
impl UnsafeUnpin for PreparedBlock
impl UnwindSafe for PreparedBlock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 736 bytes