Struct ckb_chain::chain::ChainController [−][src]
pub struct ChainController { /* fields omitted */ }
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
pub fn new(
process_block_sender: Sender<Request<(Arc<BlockView>, Switch), Result<bool, Error>>>,
truncate_sender: Sender<Request<Byte32, Result<(), Error>>>,
stop: StopHandler<()>
) -> Self
Inserts the block into database.
Expects the block’s header to be valid and already verified.
If the block already exists, does nothing and false is returned.
BlockVerifier NonContextualBlockTxsVerifier ContextualBlockVerifier will performed
Internal method insert block for test
switch bit flags for particular verify, make easier to generating test data
Truncate chain to specified target
Should use for testing only
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ChainController
impl Send for ChainController
impl Sync for ChainController
impl Unpin for ChainController
impl !UnwindSafe for ChainController
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V