mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Storage chains sync (#9171)
* Sync storage chains * Test * Apply suggestions from code review Co-authored-by: cheme <emericchevalier.pro@gmail.com> * Separate block body and indexed body * Update client/db/src/lib.rs Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
@@ -660,6 +660,8 @@ pub struct FullPeerConfig {
|
||||
pub is_authority: bool,
|
||||
/// Syncing mode
|
||||
pub sync_mode: SyncMode,
|
||||
/// Enable transaction indexing.
|
||||
pub storage_chain: bool,
|
||||
}
|
||||
|
||||
pub trait TestNetFactory: Sized where <Self::BlockImport as BlockImport<Block>>::Transaction: Send {
|
||||
@@ -715,9 +717,11 @@ pub trait TestNetFactory: Sized where <Self::BlockImport as BlockImport<Block>>:
|
||||
|
||||
/// Add a full peer.
|
||||
fn add_full_peer_with_config(&mut self, config: FullPeerConfig) {
|
||||
let mut test_client_builder = match config.keep_blocks {
|
||||
Some(keep_blocks) => TestClientBuilder::with_pruning_window(keep_blocks),
|
||||
None => TestClientBuilder::with_default_backend(),
|
||||
let mut test_client_builder = match (config.keep_blocks, config.storage_chain) {
|
||||
(Some(keep_blocks), true) => TestClientBuilder::with_tx_storage(keep_blocks),
|
||||
(None, true) => TestClientBuilder::with_tx_storage(u32::MAX),
|
||||
(Some(keep_blocks), false) => TestClientBuilder::with_pruning_window(keep_blocks),
|
||||
(None, false) => TestClientBuilder::with_default_backend(),
|
||||
};
|
||||
if matches!(config.sync_mode, SyncMode::Fast{..}) {
|
||||
test_client_builder = test_client_builder.set_no_genesis();
|
||||
|
||||
Reference in New Issue
Block a user