pub struct ChainController { /* private fields */ }Expand description
Controller to the chain service.
The controller is internally reference-counted and can be freely cloned.
A controller can invoke ChainService methods.
Implementations§
Source§impl ChainController
impl ChainController
pub fn is_verifying_unverified_blocks_on_startup(&self) -> bool
pub fn asynchronous_process_remote_block(&self, remote_block: RemoteBlock)
pub fn asynchronous_process_lonely_block(&self, lonely_block: LonelyBlock)
Sourcepub fn blocking_process_block(&self, block: Arc<BlockView>) -> VerifyResult
pub fn blocking_process_block(&self, block: Arc<BlockView>) -> VerifyResult
MinerRpc::submit_block and ckb import need this blocking way to process block
Sourcepub fn blocking_process_block_with_switch(
&self,
block: Arc<BlockView>,
switch: Switch,
) -> VerifyResult
pub fn blocking_process_block_with_switch( &self, block: Arc<BlockView>, switch: Switch, ) -> VerifyResult
IntegrationTestRpcImpl::process_block_without_verify need this
Sourcepub fn truncate(&self, target_tip_hash: Byte32) -> Result<(), Error>
pub fn truncate(&self, target_tip_hash: Byte32) -> Result<(), Error>
Truncate chain to specified target
Should use for testing only
Sourcepub fn get_orphan_block(
&self,
store: &ChainDB,
hash: &Byte32,
) -> Option<Arc<BlockView>>
pub fn get_orphan_block( &self, store: &ChainDB, hash: &Byte32, ) -> Option<Arc<BlockView>>
Relayer::reconstruct_block need this
Sourcepub fn orphan_blocks_len(&self) -> usize
pub fn orphan_blocks_len(&self) -> usize
NetRpcImpl::sync_state rpc need this
Trait Implementations§
Source§impl Clone for ChainController
impl Clone for ChainController
Source§fn clone(&self) -> ChainController
fn clone(&self) -> ChainController
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChainController
impl !RefUnwindSafe for ChainController
impl Send for ChainController
impl Sync for ChainController
impl Unpin for ChainController
impl !UnwindSafe for ChainController
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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