diff --git a/chain-spec-generator/src/common.rs b/chain-spec-generator/src/common.rs index 165409d..20b163e 100644 --- a/chain-spec-generator/src/common.rs +++ b/chain-spec-generator/src/common.rs @@ -68,15 +68,12 @@ pub fn from_json_file(filepath: &str, supported: String) -> Result { - Ok(Box::new(PaseoChainSpec::from_json_file(path)?)) - }, - x if x.starts_with("asset-hub-paseo") => { - Ok(Box::new(AssetHubPaseoChainSpec::from_json_file(path)?)) - }, - x if x.starts_with("bridge-hub-paseo") => { - Ok(Box::new(BridgeHubPaseoChainSpec::from_json_file(path)?)) - }, + x if x.starts_with("paseo") | x.starts_with("dot") => + Ok(Box::new(PaseoChainSpec::from_json_file(path)?)), + x if x.starts_with("asset-hub-paseo") => + Ok(Box::new(AssetHubPaseoChainSpec::from_json_file(path)?)), + x if x.starts_with("bridge-hub-paseo") => + Ok(Box::new(BridgeHubPaseoChainSpec::from_json_file(path)?)), _ => Err(format!("Unknown chain 'id' in json file. Only supported: {supported}'")), } } diff --git a/chain-spec-generator/src/main.rs b/chain-spec-generator/src/main.rs index 34106b9..d4169f5 100644 --- a/chain-spec-generator/src/main.rs +++ b/chain-spec-generator/src/main.rs @@ -60,8 +60,7 @@ fn main() -> Result<(), String> { ), ( "people-paseo-local", - Box::new(|| system_parachains_specs::people_paseo_local_testnet_config()) - as Box<_>, + Box::new(|| system_parachains_specs::people_paseo_local_testnet_config()) as Box<_>, ), ]); @@ -70,7 +69,7 @@ fn main() -> Result<(), String> { print!("{chain_spec}"); Ok(()) } else { - let supported = supported_chains.keys().enumerate().fold(String::new(), |c, (n, k)| { + let supported = supported_chains.keys().enumerate().fold(String::new(), |c, (n, k)| { let extra = if n + 1 < supported_chains.len() { ", " } else { "" }; format!("{c}{k}{extra}") }); diff --git a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo/src/genesis.rs b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo/src/genesis.rs index 542e3f1..9410b06 100644 --- a/integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo/src/genesis.rs +++ b/integration-tests/emulated/chains/parachains/bridges/bridge-hub-paseo/src/genesis.rs @@ -14,7 +14,7 @@ // limitations under the License. // Substrate -use sp_core::{storage::Storage}; +use sp_core::storage::Storage; // Cumulus use emulated_integration_tests_common::{ @@ -46,8 +46,8 @@ pub fn genesis() -> Storage { .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id + acc.clone(), // account id + acc, // validator id bridge_hub_paseo_runtime::SessionKeys { aura }, // session keys ) }) @@ -67,7 +67,6 @@ pub fn genesis() -> Storage { build_genesis_storage( &genesis_config, - bridge_hub_paseo_runtime::WASM_BINARY - .expect("WASM binary was not built, please build it!"), + bridge_hub_paseo_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), ) } diff --git a/integration-tests/emulated/chains/relays/paseo/src/genesis.rs b/integration-tests/emulated/chains/relays/paseo/src/genesis.rs index f823070..c50d412 100644 --- a/integration-tests/emulated/chains/relays/paseo/src/genesis.rs +++ b/integration-tests/emulated/chains/relays/paseo/src/genesis.rs @@ -112,9 +112,7 @@ pub fn genesis() -> Storage { minimum_validator_count: 1, stakers: validators::initial_authorities() .iter() - .map(|x| { - (x.0.clone(), x.1.clone(), STASH, paseo_runtime::StakerStatus::Validator) - }) + .map(|x| (x.0.clone(), x.1.clone(), STASH, paseo_runtime::StakerStatus::Validator)) .collect(), invulnerables: validators::initial_authorities().iter().map(|x| x.0.clone()).collect(), force_era: pallet_staking::Forcing::ForceNone, diff --git a/integration-tests/emulated/networks/paseo-system/src/lib.rs b/integration-tests/emulated/networks/paseo-system/src/lib.rs index 31b657c..e6383cc 100644 --- a/integration-tests/emulated/networks/paseo-system/src/lib.rs +++ b/integration-tests/emulated/networks/paseo-system/src/lib.rs @@ -15,13 +15,13 @@ pub use asset_hub_paseo_emulated_chain; pub use bridge_hub_paseo_emulated_chain; -pub use penpal_emulated_chain; pub use paseo_emulated_chain; +pub use penpal_emulated_chain; use asset_hub_paseo_emulated_chain::AssetHubPaseo; use bridge_hub_paseo_emulated_chain::BridgeHubPaseo; -use penpal_emulated_chain::PenpalB; use paseo_emulated_chain::Paseo; +use penpal_emulated_chain::PenpalB; // Cumulus use emulated_integration_tests_common::{ diff --git a/relay/paseo/src/impls.rs b/relay/paseo/src/impls.rs index ec9f762..4c916f6 100644 --- a/relay/paseo/src/impls.rs +++ b/relay/paseo/src/impls.rs @@ -23,9 +23,9 @@ use frame_support::{ traits::{tokens::ConversionFromAssetBalance, Contains}, }; use frame_system::RawOrigin; +use paseo_runtime_constants::system_parachain::PEOPLE_ID; use polkadot_primitives::Id as ParaId; use polkadot_runtime_common::identity_migrator::{OnReapIdentity, WeightInfo}; -use paseo_runtime_constants::system_parachain::PEOPLE_ID; use xcm::{latest::prelude::*, VersionedXcm}; use xcm_builder::IsChildSystemParachain; use xcm_executor::traits::TransactAsset; diff --git a/relay/paseo/src/lib.rs b/relay/paseo/src/lib.rs index 8c68b39..6fe2672 100644 --- a/relay/paseo/src/lib.rs +++ b/relay/paseo/src/lib.rs @@ -26,8 +26,8 @@ use polkadot_runtime_common::{ impls::{ DealWithFees, LocatableAssetConverter, VersionedLocatableAsset, VersionedLocationConverter, }, - paras_registrar, paras_sudo_wrapper, prod_or_fast, slots, BlockHashCount, BlockLength, CurrencyToVote, - SlowAdjustingFeeUpdate, + paras_registrar, paras_sudo_wrapper, prod_or_fast, slots, BlockHashCount, BlockLength, + CurrencyToVote, SlowAdjustingFeeUpdate, }; use runtime_parachains::{ @@ -1252,7 +1252,8 @@ impl InstanceFilter for ProxyType { matches!( c, RuntimeCall::Staking(..) | - RuntimeCall::Session(..) | RuntimeCall::Utility(..) | + RuntimeCall::Session(..) | + RuntimeCall::Utility(..) | RuntimeCall::FastUnstake(..) | RuntimeCall::VoterList(..) | RuntimeCall::NominationPools(..) @@ -1776,7 +1777,7 @@ construct_runtime! { Mmr: pallet_mmr = 201, BeefyMmrLeaf: pallet_beefy_mmr = 202, - // Sudo. + // Sudo. ParaSudoWrapper: paras_sudo_wrapper = 250, Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 255, diff --git a/relay/paseo/src/xcm_config.rs b/relay/paseo/src/xcm_config.rs index 16c429e..6f08b53 100644 --- a/relay/paseo/src/xcm_config.rs +++ b/relay/paseo/src/xcm_config.rs @@ -27,13 +27,13 @@ use frame_support::{ }; use frame_system::EnsureRoot; use pallet_xcm::XcmPassthrough; +use paseo_runtime_constants::{ + currency::CENTS, system_parachain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, +}; use polkadot_runtime_common::{ xcm_sender::{ChildParachainRouter, ExponentialPrice}, ToAuthor, }; -use paseo_runtime_constants::{ - currency::CENTS, system_parachain::*, xcm::body::FELLOWSHIP_ADMIN_INDEX, -}; use sp_core::ConstU32; use xcm::latest::prelude::*; use xcm_builder::{ diff --git a/system-parachains/asset-hub-paseo/src/lib.rs b/system-parachains/asset-hub-paseo/src/lib.rs index 75bc58f..2de154a 100644 --- a/system-parachains/asset-hub-paseo/src/lib.rs +++ b/system-parachains/asset-hub-paseo/src/lib.rs @@ -106,8 +106,8 @@ use frame_system::{ }; use pallet_nfts::PalletFeatures; use parachains_common::{ - message_queue::*, AccountId, AuraId, AssetIdForTrustBackedAssets, - Balance, BlockNumber, Hash, Header, Nonce, Signature, + message_queue::*, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash, + Header, Nonce, Signature, }; use sp_runtime::RuntimeDebug; @@ -495,7 +495,8 @@ impl InstanceFilter for ProxyType { RuntimeCall::Assets { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | - RuntimeCall::Nfts { .. } | RuntimeCall::Uniques { .. } + RuntimeCall::Nfts { .. } | + RuntimeCall::Uniques { .. } ) }, ProxyType::AssetOwner => matches!( diff --git a/system-parachains/asset-hub-paseo/src/xcm_config.rs b/system-parachains/asset-hub-paseo/src/xcm_config.rs index d23bb54..63299b6 100644 --- a/system-parachains/asset-hub-paseo/src/xcm_config.rs +++ b/system-parachains/asset-hub-paseo/src/xcm_config.rs @@ -226,7 +226,6 @@ parameter_types! { pub XcmAssetFeesReceiver: Option = Authorship::author(); } - pub struct ParentOrParentsPlurality; impl Contains for ParentOrParentsPlurality { fn contains(location: &Location) -> bool { @@ -253,7 +252,7 @@ pub type Barrier = TrailingSetTopicAsId< AllowExplicitUnpaidExecutionFrom<( ParentOrParentsPlurality, Equals, - Equals + Equals, )>, // Subscriptions for version tracking are OK. AllowSubscriptionsFrom, diff --git a/system-parachains/bridge-hub-paseo/primitives/src/lib.rs b/system-parachains/bridge-hub-paseo/primitives/src/lib.rs index 014462b..498648a 100644 --- a/system-parachains/bridge-hub-paseo/primitives/src/lib.rs +++ b/system-parachains/bridge-hub-paseo/primitives/src/lib.rs @@ -110,11 +110,11 @@ pub fn estimate_paseo_to_kusama_message_fee( // 1) an approximate cost of XCM execution (`ExportMessage` and surroundings) at Paseo bridge // Hub; // - // 2) the approximate cost of Paseo -> Kusama message delivery transaction on Kusama Bridge - // Hub, converted into KSMs using 1:5 conversion rate; + // 2) the approximate cost of Paseo -> Kusama message delivery transaction on Kusama Bridge Hub, + // converted into KSMs using 1:5 conversion rate; // - // 3) the approximate cost of Paseo -> Kusama message confirmation transaction on Paseo - // Bridge Hub. + // 3) the approximate cost of Paseo -> Kusama message confirmation transaction on Paseo Bridge + // Hub. BridgeHubPaseoBaseXcmFeeInDots::get() .saturating_add(convert_from_uksm_to_udot(bridge_hub_kusama_base_delivery_fee_in_uksms)) .saturating_add(BridgeHubPaseoBaseConfirmationFeeInDots::get()) @@ -124,8 +124,8 @@ pub fn estimate_paseo_to_kusama_message_fee( /// message from Paseo Bridge Hub to Kusama Bridge Hub. pub fn estimate_paseo_to_kusama_byte_fee() -> Balance { // the sender pays for the same byte twice: - // 1) the first part comes from the HRMP, when message travels from Paseo Asset Hub to - // Paseo Bridge Hub; + // 1) the first part comes from the HRMP, when message travels from Paseo Asset Hub to Paseo + // Bridge Hub; // 2) the second part is the payment for bytes of the message delivery transaction, which is // "mined" at Kusama Bridge Hub. Hence, we need to use byte fees from that chain and convert // it to PASs here. @@ -138,7 +138,7 @@ fn convert_from_uksm_to_udot(price_in_uksm: Balance) -> Balance { let dot_to_ksm_economic_rate = FixedU128::from_rational(5, 1); // tokens have different nominals and we need to take that into account let nominal_ratio = FixedU128::from_rational( - paseo_runtime_constants::currency::UNITS, + paseo_runtime_constants::currency::UNITS, kusama_runtime_constants::currency::UNITS, ); @@ -199,10 +199,8 @@ mod tests { let price_in_ksm = FixedU128::from_rational(price_in_uksm, kusama_runtime_constants::currency::UNITS); - let price_in_dot = FixedU128::from_rational( - same_price_in_udot, - paseo_runtime_constants::currency::UNITS, - ); + let price_in_dot = + FixedU128::from_rational(same_price_in_udot, paseo_runtime_constants::currency::UNITS); assert_eq!(price_in_dot / FixedU128::saturating_from_integer(5), price_in_ksm); } } diff --git a/system-parachains/bridge-hub-paseo/src/lib.rs b/system-parachains/bridge-hub-paseo/src/lib.rs index ed9095b..7c3d0e6 100644 --- a/system-parachains/bridge-hub-paseo/src/lib.rs +++ b/system-parachains/bridge-hub-paseo/src/lib.rs @@ -78,8 +78,8 @@ use xcm_config::{ pub use sp_runtime::BuildStorage; // Polkadot imports -use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use paseo_runtime_constants::system_parachain::{ASSET_HUB_ID, BRIDGE_HUB_ID}; +use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; diff --git a/system-parachains/bridge-hub-paseo/src/xcm_config.rs b/system-parachains/bridge-hub-paseo/src/xcm_config.rs index e01f0dc..73b8a69 100644 --- a/system-parachains/bridge-hub-paseo/src/xcm_config.rs +++ b/system-parachains/bridge-hub-paseo/src/xcm_config.rs @@ -31,8 +31,8 @@ use parachains_common::xcm_config::{ AllSiblingSystemParachains, ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, RelayOrOtherSystemParachains, }; -use polkadot_parachain_primitives::primitives::Sibling; use paseo_runtime_constants::system_parachain; +use polkadot_parachain_primitives::primitives::Sibling; use snowbridge_runtime_common::XcmExportFeeToSibling; use sp_runtime::traits::AccountIdConversion; use sp_std::marker::PhantomData; diff --git a/system-parachains/people-paseo/src/xcm_config.rs b/system-parachains/people-paseo/src/xcm_config.rs index 7983f8c..93ef09f 100644 --- a/system-parachains/people-paseo/src/xcm_config.rs +++ b/system-parachains/people-paseo/src/xcm_config.rs @@ -31,8 +31,8 @@ use parachains_common::{ }, TREASURY_PALLET_ID, }; -use polkadot_parachain_primitives::primitives::Sibling; use paseo_runtime_constants::system_parachain; +use polkadot_parachain_primitives::primitives::Sibling; use sp_runtime::traits::AccountIdConversion; use xcm::latest::prelude::*; use xcm_builder::{