Struct ethcore::block::LockedBlock
source · [−]pub struct LockedBlock { /* private fields */ }
Expand description
Just like ClosedBlock
except that we can’t reopen it and it’s faster.
We actually store the post-Engine::on_close_block
state, unlike in ClosedBlock
where it’s the pre.
Implementations
sourceimpl LockedBlock
impl LockedBlock
sourcepub fn strip_receipts_outcomes(&mut self)
pub fn strip_receipts_outcomes(&mut self)
Removes outcomes from receipts and updates the receipt root.
This is done after the block is enacted for historical reasons.
We allow inconsistency in receipts for some chains if validate_receipts_transition
is set to non-zero value, so the check only happens if we detect
unmatching root first and then fall back to striped receipts.
sourcepub fn seal(
self,
engine: &dyn EthEngine,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
pub fn seal(
self,
engine: &dyn EthEngine,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
Provide a valid seal in order to turn this into a SealedBlock
.
NOTE: This does not check the validity of seal
with the engine.
sourcepub fn try_seal(
self,
engine: &dyn EthEngine,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
pub fn try_seal(
self,
engine: &dyn EthEngine,
seal: Vec<Bytes>
) -> Result<SealedBlock, Error>
Provide a valid seal in order to turn this into a SealedBlock
.
This does check the validity of seal
with the engine.
Returns the ClosedBlock
back again if the seal is no good.
TODO(https://github.com/openethereum/openethereum/issues/10407): This is currently only used in POW chain call paths, we should really merge it with seal() above.
Methods from Deref<Target = ExecutedBlock>
Trait Implementations
sourceimpl Clone for LockedBlock
impl Clone for LockedBlock
sourcefn clone(&self) -> LockedBlock
fn clone(&self) -> LockedBlock
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Deref for LockedBlock
impl Deref for LockedBlock
type Target = ExecutedBlock
type Target = ExecutedBlock
The resulting type after dereferencing.
sourceimpl Drain for LockedBlock
impl Drain for LockedBlock
sourcefn drain(self) -> ExecutedBlock
fn drain(self) -> ExecutedBlock
Returns ExecutedBlock
Auto Trait Implementations
impl !RefUnwindSafe for LockedBlock
impl Send for LockedBlock
impl !Sync for LockedBlock
impl Unpin for LockedBlock
impl !UnwindSafe for LockedBlock
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more