Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier committed Jul 13, 2023
1 parent 5c1d1c3 commit f55d979
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 31 deletions.
5 changes: 4 additions & 1 deletion client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ where
// We want that collators wait at maximum the relay chain slot duration before starting
// to recover blocks. Additionally, we wait at least half the slot time to give the
// relay chain the chance to increase availability.
RecoveryDelayRange { min: relay_chain_slot_duration / 2, max: relay_chain_slot_duration }
RecoveryDelayRange {
min: relay_chain_slot_duration / 2,
max: relay_chain_slot_duration,
}
},
DARecoveryProfile::FullNode => {
// Full nodes should at least wait 2.5 minutes (assuming 6 seconds slot duration) and
Expand Down
11 changes: 6 additions & 5 deletions parachain-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, Slo
use cumulus_client_consensus_common::{
ParachainBlockImport as TParachainBlockImport, ParachainConsensus,
};
use cumulus_client_service::{
DARecoveryProfile,
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, BuildNetworkParams, StartRelayChainTasksParams,
};
#[allow(deprecated)]
use cumulus_client_service::old_consensus;
use cumulus_client_service::{
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
BuildNetworkParams, DARecoveryProfile, StartRelayChainTasksParams,
};
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_interface::RelayChainInterface;

Expand Down Expand Up @@ -297,7 +297,8 @@ async fn start_node_impl(
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle.clone()),
sync_service: sync_service.clone(),
}).await?;
})
.await?;

if validator {
let parachain_consensus = build_consensus(
Expand Down
8 changes: 4 additions & 4 deletions parachains/runtimes/assets/test-utils/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ pub fn teleports_for_native_asset_works<
+ pallet_collator_selection::Config
+ cumulus_pallet_parachain_system::Config
+ cumulus_pallet_xcmp_queue::Config,
AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Runtime>>
+ OnFinalize<BlockNumberFor<Runtime>>,
AllPalletsWithoutSystem:
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
AccountIdOf<Runtime>: Into<[u8; 32]>,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
BalanceOf<Runtime>: From<Balance> + Into<u128>,
Expand Down Expand Up @@ -319,8 +319,8 @@ pub fn teleports_for_foreign_assets_works<
+ cumulus_pallet_parachain_system::Config
+ cumulus_pallet_xcmp_queue::Config
+ pallet_assets::Config<ForeignAssetsPalletInstance>,
AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Runtime>>
+ OnFinalize<BlockNumberFor<Runtime>>,
AllPalletsWithoutSystem:
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
AccountIdOf<Runtime>: Into<[u8; 32]>,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
BalanceOf<Runtime>: From<Balance>,
Expand Down
4 changes: 2 additions & 2 deletions parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ pub fn message_dispatch_routing_works<
+ cumulus_pallet_parachain_system::Config
+ cumulus_pallet_xcmp_queue::Config
+ pallet_bridge_messages::Config<MessagesPalletInstance, InboundPayload = XcmAsPlainPayload>,
AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Runtime>>
+ OnFinalize<BlockNumberFor<Runtime>>,
AllPalletsWithoutSystem:
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
<Runtime as frame_system::Config>::AccountId:
Into<<<Runtime as frame_system::Config>::RuntimeOrigin as OriginTrait>::AccountId>,
XcmConfig: xcm_executor::Config,
Expand Down
8 changes: 4 additions & 4 deletions parachains/runtimes/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder;
use frame_support::{
dispatch::{DispatchResult, RawOrigin, UnfilteredDispatchable},
inherent::{InherentData, ProvideInherent},
traits::{OriginTrait, OnInitialize, OnFinalize},
traits::{OnFinalize, OnInitialize, OriginTrait},
weights::Weight,
};
use frame_system::pallet_prelude::{BlockNumberFor, HeaderFor};
Expand All @@ -34,7 +34,7 @@ use polkadot_parachain::primitives::{
};
use sp_consensus_aura::{SlotDuration, AURA_ENGINE_ID};
use sp_core::Encode;
use sp_runtime::{BuildStorage, Digest, DigestItem, traits::Header};
use sp_runtime::{traits::Header, BuildStorage, Digest, DigestItem};
use xcm::{
latest::{MultiAsset, MultiLocation, XcmContext, XcmHash},
prelude::*,
Expand Down Expand Up @@ -220,8 +220,8 @@ impl<Runtime: frame_system::Config, AllPalletsWithoutSystem>
where
AccountIdOf<Runtime>:
Into<<<Runtime as frame_system::Config>::RuntimeOrigin as OriginTrait>::AccountId>,
AllPalletsWithoutSystem: OnInitialize<BlockNumberFor<Runtime>>
+ OnFinalize<BlockNumberFor<Runtime>>,
AllPalletsWithoutSystem:
OnInitialize<BlockNumberFor<Runtime>> + OnFinalize<BlockNumberFor<Runtime>>,
{
pub fn run_to_block(n: u32, author: AccountId) -> HeaderFor<Runtime> {
let mut last_header = None;
Expand Down
24 changes: 15 additions & 9 deletions polkadot-parachain/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, Slo
use cumulus_client_consensus_common::{
ParachainBlockImport as TParachainBlockImport, ParachainCandidate, ParachainConsensus,
};
#[allow(deprecated)]
use cumulus_client_service::old_consensus;
use cumulus_client_service::{
build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks,
DARecoveryProfile, StartRelayChainTasksParams, BuildNetworkParams,
BuildNetworkParams, DARecoveryProfile, StartRelayChainTasksParams,
};
#[allow(deprecated)]
use cumulus_client_service::old_consensus;
use cumulus_primitives_core::{
relay_chain::{Hash as PHash, PersistedValidationData},
ParaId,
Expand Down Expand Up @@ -483,7 +483,8 @@ where
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle.clone()),
sync_service: sync_service.clone(),
}).await?;
})
.await?;

if validator {
let parachain_consensus = build_consensus(
Expand Down Expand Up @@ -511,7 +512,8 @@ where
spawner,
key: collator_key.expect("Command line arguments do not allow this. qed"),
parachain_consensus,
}).await;
})
.await;
}

start_network.start_network();
Expand Down Expand Up @@ -684,7 +686,8 @@ where
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle.clone()),
sync_service: sync_service.clone(),
}).await?;
})
.await?;

if validator {
let parachain_consensus = build_consensus(
Expand Down Expand Up @@ -712,7 +715,8 @@ where
spawner,
key: collator_key.expect("Command line arguments do not allow this. qed"),
parachain_consensus,
}).await;
})
.await;
}

start_network.start_network();
Expand Down Expand Up @@ -1455,7 +1459,8 @@ where
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle.clone()),
sync_service: sync_service.clone(),
}).await?;
})
.await?;

if validator {
let parachain_consensus = build_consensus(
Expand Down Expand Up @@ -1483,7 +1488,8 @@ where
spawner,
key: collator_key.expect("Command line arguments do not allow this. qed"),
parachain_consensus,
}).await;
})
.await;
}

start_network.start_network();
Expand Down
4 changes: 3 additions & 1 deletion test/relay-sproof-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ impl RelayStateSproofBuilder {
if let Some(para_head) = self.included_para_head {
insert(relay_chain::well_known_keys::para_head(self.para_id), para_head.encode());
}
if let Some(relay_dispatch_queue_remaining_capacity) = self.relay_dispatch_queue_remaining_capacity {
if let Some(relay_dispatch_queue_remaining_capacity) =
self.relay_dispatch_queue_remaining_capacity
{
insert(
relay_chain::well_known_keys::relay_dispatch_queue_remaining_capacity(
self.para_id,
Expand Down
13 changes: 8 additions & 5 deletions test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ use cumulus_client_consensus_common::{
ParachainBlockImport as TParachainBlockImport, ParachainCandidate, ParachainConsensus,
};
use cumulus_client_pov_recovery::RecoveryHandle;
use cumulus_client_service::{
build_network, prepare_node_config, start_relay_chain_tasks, DARecoveryProfile, StartRelayChainTasksParams, BuildNetworkParams,
};
#[allow(deprecated)]
use cumulus_client_service::old_consensus;
use cumulus_client_service::{
build_network, prepare_node_config, start_relay_chain_tasks, BuildNetworkParams,
DARecoveryProfile, StartRelayChainTasksParams,
};
use cumulus_primitives_core::ParaId;
use cumulus_relay_chain_inprocess_interface::RelayChainInProcessInterface;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};
Expand Down Expand Up @@ -403,7 +404,8 @@ where
relay_chain_slot_duration: relay_chain_slot_duration.clone(),
recovery_handle,
sync_service: sync_service.clone(),
}).await?;
})
.await?;

if let Some(collator_key) = collator_key {
let parachain_consensus: Box<dyn ParachainConsensus<Block>> = match consensus {
Expand Down Expand Up @@ -457,7 +459,8 @@ where
parachain_consensus,
key: collator_key,
overseer_handle,
}).await;
})
.await;
}

start_network.start_network();
Expand Down

0 comments on commit f55d979

Please sign in to comment.