mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Check block CLI command (#4240)
* Check block operation * Update client/cli/src/lib.rs * Update client/cli/src/params.rs
This commit is contained in:
committed by
Gavin Wood
parent
f78b83e363
commit
504e2f8bd5
@@ -105,6 +105,8 @@ pub struct BlockCheckParams<Block: BlockT> {
|
||||
pub parent_hash: Block::Hash,
|
||||
/// Allow importing the block skipping state verification if parent state is missing.
|
||||
pub allow_missing_state: bool,
|
||||
/// Re-validate existing block.
|
||||
pub import_existing: bool,
|
||||
}
|
||||
|
||||
/// Data required to import a Block.
|
||||
@@ -142,6 +144,8 @@ pub struct BlockImportParams<Block: BlockT> {
|
||||
pub fork_choice: ForkChoiceStrategy,
|
||||
/// Allow importing the block skipping state verification if parent state is missing.
|
||||
pub allow_missing_state: bool,
|
||||
/// Re-validate existing block.
|
||||
pub import_existing: bool,
|
||||
}
|
||||
|
||||
impl<Block: BlockT> BlockImportParams<Block> {
|
||||
|
||||
@@ -65,6 +65,8 @@ pub struct IncomingBlock<B: BlockT> {
|
||||
pub origin: Option<Origin>,
|
||||
/// Allow importing the block skipping state verification if parent state is missing.
|
||||
pub allow_missing_state: bool,
|
||||
/// Re-validate existing block.
|
||||
pub import_existing: bool,
|
||||
}
|
||||
|
||||
/// Type of keys in the blockchain cache that consensus module could use for its needs.
|
||||
@@ -230,6 +232,7 @@ pub fn import_single_block<B: BlockT, V: Verifier<B>>(
|
||||
number,
|
||||
parent_hash,
|
||||
allow_missing_state: block.allow_missing_state,
|
||||
import_existing: block.import_existing,
|
||||
}))? {
|
||||
BlockImportResult::ImportedUnknown { .. } => (),
|
||||
r => return Ok(r), // Any other successful result means that the block is already imported.
|
||||
|
||||
Reference in New Issue
Block a user