diff --git a/cumulus/Cargo.lock b/cumulus/Cargo.lock index adf8b34d3c03bfb37616ea4e81688b797492f6f2..cfe6899c30e53ff44653e993119dfe92e2a13e7a 100644 --- a/cumulus/Cargo.lock +++ b/cumulus/Cargo.lock @@ -10954,6 +10954,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal 0.3.4", + "kusama-runtime-constants", "log", "node-primitives", "pallet-asset-tx-payment", @@ -11043,6 +11044,7 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain", "polkadot-runtime-common", + "polkadot-runtime-constants", "scale-info", "serde", "smallvec", @@ -12478,6 +12480,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", + "westend-runtime-constants", "xcm", "xcm-builder", "xcm-executor", diff --git a/cumulus/client/cli/src/lib.rs b/cumulus/client/cli/src/lib.rs index 0f031d442f0724097dd9c8cf13fc95cd1cc80f29..8cb14f399e5b5c4d005f85337c6c7a051881c501 100644 --- a/cumulus/client/cli/src/lib.rs +++ b/cumulus/client/cli/src/lib.rs @@ -54,8 +54,9 @@ impl PurgeChainCmd { relay_config: sc_service::Configuration, ) -> sc_cli::Result<()> { let databases = match (self.parachain, self.relaychain) { - (true, true) | (false, false) => - vec![("parachain", para_config.database), ("relaychain", relay_config.database)], + (true, true) | (false, false) => { + vec![("parachain", para_config.database), ("relaychain", relay_config.database)] + }, (true, false) => vec![("parachain", para_config.database)], (false, true) => vec![("relaychain", relay_config.database)], }; diff --git a/cumulus/parachain-template/node/src/command.rs b/cumulus/parachain-template/node/src/command.rs index 925815cf14217f7732e78b20ad2dc28a380e2eaf..f6bbef018c1257eac7c4f0b828d3c35f89a8d184 100644 --- a/cumulus/parachain-template/node/src/command.rs +++ b/cumulus/parachain-template/node/src/command.rs @@ -241,7 +241,7 @@ pub fn run() -> Result<()> { You can enable it with `--features runtime-benchmarks`." .into()) }, - Some(Subcommand::TryRuntime(cmd)) => + Some(Subcommand::TryRuntime(cmd)) => { if cfg!(feature = "try-runtime") { let runner = cli.create_runner(cmd)?; @@ -256,7 +256,8 @@ pub fn run() -> Result<()> { }) } else { Err("Try-runtime must be enabled by `--features try-runtime`.".into()) - }, + } + }, None => { let runner = cli.create_runner(&cli.run.normalize())?; diff --git a/cumulus/polkadot-parachains/src/command.rs b/cumulus/polkadot-parachains/src/command.rs index 454eeb1236748e259adec476db3f9bc9c5aadcf4..afac6c077e4a53106ca6d2291a71777a4f0f6461 100644 --- a/cumulus/polkadot-parachains/src/command.rs +++ b/cumulus/polkadot-parachains/src/command.rs @@ -418,7 +418,7 @@ pub fn run() -> Result<()> { You can enable it with `--features runtime-benchmarks`." .into()) }, - Some(Subcommand::TryRuntime(cmd)) => + Some(Subcommand::TryRuntime(cmd)) => { if cfg!(feature = "try-runtime") { // grab the task manager. let runner = cli.create_runner(cmd)?; @@ -448,7 +448,8 @@ pub fn run() -> Result<()> { } } else { Err("Try-runtime must be enabled by `--features try-runtime`.".into()) - }, + } + }, Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?), None => { let runner = cli.create_runner(&cli.run.normalize())?; diff --git a/cumulus/polkadot-parachains/statemine/Cargo.toml b/cumulus/polkadot-parachains/statemine/Cargo.toml index 5f4166ac5e8dbdec4d94f3a9c02974ed2ef4ad83..18f3b6c4e30d6a052c6d8bd2af76415323118976 100644 --- a/cumulus/polkadot-parachains/statemine/Cargo.toml +++ b/cumulus/polkadot-parachains/statemine/Cargo.toml @@ -68,6 +68,7 @@ parachains-common = { path = "../parachains-common", default-features = false } # Polkadot dependencies polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } diff --git a/cumulus/polkadot-parachains/statemine/src/constants.rs b/cumulus/polkadot-parachains/statemine/src/constants.rs index 7643e80384e6bf64c22ed1cb91d17a6601fdc346..69384141a2ecaf76d2bd4d7ea5a7d91db2e2a1d5 100644 --- a/cumulus/polkadot-parachains/statemine/src/constants.rs +++ b/cumulus/polkadot-parachains/statemine/src/constants.rs @@ -14,19 +14,20 @@ // limitations under the License. pub mod currency { + use kusama_runtime_constants as constants; use node_primitives::Balance; - /// The existential deposit. Set to 1/10 of its parent Relay Chain (v9020). - pub const EXISTENTIAL_DEPOSIT: Balance = CENTS / 10; + /// The existential deposit. Set to 1/10 of its parent Relay Chain. + pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; - pub const UNITS: Balance = 1_000_000_000_000; - pub const CENTS: Balance = UNITS / 30_000; - pub const GRAND: Balance = CENTS * 100_000; - pub const MILLICENTS: Balance = CENTS / 1_000; + pub const UNITS: Balance = constants::currency::UNITS; + pub const CENTS: Balance = constants::currency::CENTS; + pub const GRAND: Balance = constants::currency::GRAND; + pub const MILLICENTS: Balance = constants::currency::MILLICENTS; pub const fn deposit(items: u32, bytes: u32) -> Balance { // map to 1/10 of what the kusama relay chain charges (v9020) - (items as Balance * 2_000 * CENTS + (bytes as Balance) * 100 * MILLICENTS) / 10 + constants::currency::deposit(items, bytes) / 10 } } diff --git a/cumulus/polkadot-parachains/statemint/Cargo.toml b/cumulus/polkadot-parachains/statemint/Cargo.toml index 93ed0d441533152ae5e3a03c6f82e5edc36fc24c..cddf2624ae37dc01a581e0216deae04a54fd2dc4 100644 --- a/cumulus/polkadot-parachains/statemint/Cargo.toml +++ b/cumulus/polkadot-parachains/statemint/Cargo.toml @@ -68,6 +68,7 @@ parachains-common = { path = "../parachains-common", default-features = false } # Polkadot dependencies polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +polkadot-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } diff --git a/cumulus/polkadot-parachains/statemint/src/constants.rs b/cumulus/polkadot-parachains/statemint/src/constants.rs index 376a8200d47495d873010b27dc68f0cf8e28b0df..cc91996f64ddb7f9605424e5ec2a040645c3c256 100644 --- a/cumulus/polkadot-parachains/statemint/src/constants.rs +++ b/cumulus/polkadot-parachains/statemint/src/constants.rs @@ -15,18 +15,19 @@ pub mod currency { use node_primitives::Balance; + use polkadot_runtime_constants as constants; /// The existential deposit. Set to 1/10 of its parent Relay Chain (v9010). - pub const EXISTENTIAL_DEPOSIT: Balance = 10 * CENTS; + pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; - pub const UNITS: Balance = 10_000_000_000; - pub const DOLLARS: Balance = UNITS; - pub const CENTS: Balance = UNITS / 100; // 100_000_000 - pub const MILLICENTS: Balance = CENTS / 1_000; // 100_000 + pub const UNITS: Balance = constants::currency::UNITS; + pub const DOLLARS: Balance = constants::currency::DOLLARS; + pub const CENTS: Balance = constants::currency::CENTS; + pub const MILLICENTS: Balance = constants::currency::MILLICENTS; pub const fn deposit(items: u32, bytes: u32) -> Balance { // 1/10 of Polkadot v9010 - (items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS) / 10 + constants::currency::deposit(items, bytes) / 10 } } diff --git a/cumulus/polkadot-parachains/westmint/Cargo.toml b/cumulus/polkadot-parachains/westmint/Cargo.toml index 135e767f8d0a1b7bdc56b448751592337f38be56..99a9fbda7841ea723981df1e8157b2c45b96baa4 100644 --- a/cumulus/polkadot-parachains/westmint/Cargo.toml +++ b/cumulus/polkadot-parachains/westmint/Cargo.toml @@ -67,6 +67,7 @@ parachains-common = { path = "../parachains-common", default-features = false } # Polkadot dependencies polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +westend-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } diff --git a/cumulus/polkadot-parachains/westmint/src/constants.rs b/cumulus/polkadot-parachains/westmint/src/constants.rs index 81a7e7e544d7dc5e91e3821950a8de75b0d729c2..10a8ebbe35190d87829fab567c5edec9988215ae 100644 --- a/cumulus/polkadot-parachains/westmint/src/constants.rs +++ b/cumulus/polkadot-parachains/westmint/src/constants.rs @@ -15,18 +15,19 @@ pub mod currency { use node_primitives::Balance; + use westend_runtime_constants as constants; /// The existential deposit. Set to 1/10 of its parent Relay Chain. - pub const EXISTENTIAL_DEPOSIT: Balance = 100 * MILLICENTS; + pub const EXISTENTIAL_DEPOSIT: Balance = constants::currency::EXISTENTIAL_DEPOSIT / 10; - pub const UNITS: Balance = 1_000_000_000_000; - pub const CENTS: Balance = UNITS / 100; - pub const MILLICENTS: Balance = CENTS / 1_000; - pub const GRAND: Balance = CENTS * 100_000; + pub const UNITS: Balance = constants::currency::UNITS; + pub const CENTS: Balance = constants::currency::CENTS; + pub const MILLICENTS: Balance = constants::currency::MILLICENTS; + pub const GRAND: Balance = constants::currency::GRAND; pub const fn deposit(items: u32, bytes: u32) -> Balance { // 1/10 of Westend testnet - (items as Balance * 100 * CENTS + (bytes as Balance) * 5 * MILLICENTS) / 10 + constants::currency::deposit(items, bytes) / 10 } }