mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
Extract Runtime Constants into Separate Crates (#4456)
* kusama-runtime-constants created * polkadot_runtime_constants added * runtime constants extracted * update node * cargo +nightly fmt * Delete constants.rs * update Cargo.toml * 2021 * runtime constants update * utils * utils * node test service * Update runtime/rococo/constants/Cargo.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * runtime-native * bridge messages * re-export DOLLARS * Update runtime/westend/Cargo.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update runtime/test-runtime/Cargo.toml Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * std feature Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Generated
+68
@@ -3122,6 +3122,7 @@ dependencies = [
|
||||
"frame-system-rpc-runtime-api",
|
||||
"frame-try-runtime",
|
||||
"hex-literal",
|
||||
"kusama-runtime-constants",
|
||||
"log",
|
||||
"pallet-authority-discovery",
|
||||
"pallet-authorship",
|
||||
@@ -3197,6 +3198,17 @@ dependencies = [
|
||||
"xcm-executor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kusama-runtime-constants"
|
||||
version = "0.9.13"
|
||||
dependencies = [
|
||||
"frame-support",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"smallvec",
|
||||
"sp-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "kv-log-macro"
|
||||
version = "1.0.7"
|
||||
@@ -6692,6 +6704,7 @@ dependencies = [
|
||||
"parity-scale-codec",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"polkadot-runtime-constants",
|
||||
"polkadot-runtime-parachains",
|
||||
"rustc-hex",
|
||||
"scale-info",
|
||||
@@ -6777,6 +6790,17 @@ dependencies = [
|
||||
"xcm",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-constants"
|
||||
version = "0.9.13"
|
||||
dependencies = [
|
||||
"frame-support",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"smallvec",
|
||||
"sp-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "polkadot-runtime-parachains"
|
||||
version = "0.9.13"
|
||||
@@ -6835,6 +6859,7 @@ dependencies = [
|
||||
"futures 0.3.18",
|
||||
"hex-literal",
|
||||
"kusama-runtime",
|
||||
"kusama-runtime-constants",
|
||||
"kvdb",
|
||||
"kvdb-rocksdb",
|
||||
"log",
|
||||
@@ -6875,10 +6900,12 @@ dependencies = [
|
||||
"polkadot-primitives",
|
||||
"polkadot-rpc",
|
||||
"polkadot-runtime",
|
||||
"polkadot-runtime-constants",
|
||||
"polkadot-runtime-parachains",
|
||||
"polkadot-statement-distribution",
|
||||
"polkadot-test-client",
|
||||
"rococo-runtime",
|
||||
"rococo-runtime-constants",
|
||||
"sc-authority-discovery",
|
||||
"sc-basic-authorship",
|
||||
"sc-block-builder",
|
||||
@@ -6922,6 +6949,7 @@ dependencies = [
|
||||
"thiserror",
|
||||
"tracing",
|
||||
"westend-runtime",
|
||||
"westend-runtime-constants",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7128,6 +7156,7 @@ dependencies = [
|
||||
"sp-trie",
|
||||
"sp-version",
|
||||
"substrate-wasm-builder",
|
||||
"test-runtime-constants",
|
||||
"tiny-keccak",
|
||||
"xcm",
|
||||
"xcm-builder",
|
||||
@@ -7184,6 +7213,7 @@ dependencies = [
|
||||
"substrate-test-client",
|
||||
"substrate-test-utils",
|
||||
"tempfile",
|
||||
"test-runtime-constants",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@@ -7712,14 +7742,17 @@ dependencies = [
|
||||
"clap",
|
||||
"frame-system",
|
||||
"kusama-runtime",
|
||||
"kusama-runtime-constants",
|
||||
"log",
|
||||
"pallet-bags-list-remote-tests",
|
||||
"polkadot-runtime",
|
||||
"polkadot-runtime-constants",
|
||||
"sp-core",
|
||||
"sp-tracing",
|
||||
"structopt",
|
||||
"tokio",
|
||||
"westend-runtime",
|
||||
"westend-runtime-constants",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7848,6 +7881,7 @@ dependencies = [
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"polkadot-runtime-parachains",
|
||||
"rococo-runtime-constants",
|
||||
"scale-info",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@@ -7872,6 +7906,17 @@ dependencies = [
|
||||
"xcm-executor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rococo-runtime-constants"
|
||||
version = "0.9.13"
|
||||
dependencies = [
|
||||
"frame-support",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"smallvec",
|
||||
"sp-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rpassword"
|
||||
version = "5.0.1"
|
||||
@@ -10492,6 +10537,17 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test-runtime-constants"
|
||||
version = "0.9.13"
|
||||
dependencies = [
|
||||
"frame-support",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"smallvec",
|
||||
"sp-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.11.0"
|
||||
@@ -11552,11 +11608,23 @@ dependencies = [
|
||||
"sp-version",
|
||||
"substrate-wasm-builder",
|
||||
"tiny-keccak",
|
||||
"westend-runtime-constants",
|
||||
"xcm",
|
||||
"xcm-builder",
|
||||
"xcm-executor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "westend-runtime-constants"
|
||||
version = "0.9.13"
|
||||
dependencies = [
|
||||
"frame-support",
|
||||
"polkadot-primitives",
|
||||
"polkadot-runtime-common",
|
||||
"smallvec",
|
||||
"sp-runtime",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.2.2"
|
||||
|
||||
@@ -84,6 +84,12 @@ polkadot-node-subsystem-util = { path = "../subsystem-util" }
|
||||
polkadot-runtime-parachains = { path = "../../runtime/parachains" }
|
||||
polkadot-node-network-protocol = { path = "../network/protocol" }
|
||||
|
||||
# Polkadot Runtime Constants
|
||||
polkadot-runtime-constants = { path = "../../runtime/polkadot/constants", optional = true }
|
||||
kusama-runtime-constants = { path = "../../runtime/kusama/constants", optional = true }
|
||||
rococo-runtime-constants = { path = "../../runtime/rococo/constants", optional = true }
|
||||
westend-runtime-constants = { path = "../../runtime/westend/constants", optional = true }
|
||||
|
||||
# Polkadot Runtimes
|
||||
polkadot-runtime = { path = "../../runtime/polkadot", optional = true }
|
||||
kusama-runtime = { path = "../../runtime/kusama", optional = true }
|
||||
@@ -154,10 +160,10 @@ full-node = [
|
||||
# Configure the native runtimes to use. Polkadot is enabled by default.
|
||||
#
|
||||
# Validators require the native runtime currently
|
||||
polkadot-native = [ "polkadot-runtime", "polkadot-client/polkadot" ]
|
||||
kusama-native = [ "kusama-runtime", "polkadot-client/kusama" ]
|
||||
westend-native = [ "westend-runtime", "polkadot-client/westend" ]
|
||||
rococo-native = [ "rococo-runtime", "polkadot-client/rococo" ]
|
||||
polkadot-native = [ "polkadot-runtime", "polkadot-runtime-constants", "polkadot-client/polkadot" ]
|
||||
kusama-native = [ "kusama-runtime", "kusama-runtime-constants", "polkadot-client/kusama" ]
|
||||
westend-native = [ "westend-runtime", "westend-runtime-constants", "polkadot-client/westend" ]
|
||||
rococo-native = [ "rococo-runtime", "rococo-runtime-constants", "polkadot-client/rococo" ]
|
||||
|
||||
runtime-benchmarks = [
|
||||
"polkadot-runtime/runtime-benchmarks",
|
||||
|
||||
@@ -21,21 +21,21 @@ use grandpa::AuthorityId as GrandpaId;
|
||||
#[cfg(feature = "kusama-native")]
|
||||
use kusama_runtime as kusama;
|
||||
#[cfg(feature = "kusama-native")]
|
||||
use kusama_runtime::constants::currency::UNITS as KSM;
|
||||
use kusama_runtime_constants::currency::UNITS as KSM;
|
||||
use pallet_im_online::sr25519::AuthorityId as ImOnlineId;
|
||||
use pallet_staking::Forcing;
|
||||
#[cfg(feature = "polkadot-native")]
|
||||
use polkadot::constants::currency::UNITS as DOT;
|
||||
use polkadot_primitives::v1::{AccountId, AccountPublic, AssignmentId, ValidatorId};
|
||||
#[cfg(feature = "polkadot-native")]
|
||||
use polkadot_runtime as polkadot;
|
||||
#[cfg(feature = "polkadot-native")]
|
||||
use polkadot_runtime_constants::currency::UNITS as DOT;
|
||||
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
||||
use sp_consensus_babe::AuthorityId as BabeId;
|
||||
|
||||
#[cfg(feature = "rococo-native")]
|
||||
use rococo_runtime as rococo;
|
||||
#[cfg(feature = "rococo-native")]
|
||||
use rococo_runtime::constants::currency::UNITS as ROC;
|
||||
use rococo_runtime_constants::currency::UNITS as ROC;
|
||||
use sc_chain_spec::{ChainSpecExtension, ChainType};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_core::{sr25519, Pair, Public};
|
||||
@@ -44,7 +44,7 @@ use telemetry::TelemetryEndpoints;
|
||||
#[cfg(feature = "westend-native")]
|
||||
use westend_runtime as westend;
|
||||
#[cfg(feature = "westend-native")]
|
||||
use westend_runtime::constants::currency::UNITS as WND;
|
||||
use westend_runtime_constants::currency::UNITS as WND;
|
||||
|
||||
#[cfg(feature = "polkadot-native")]
|
||||
const POLKADOT_STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
|
||||
@@ -128,7 +128,7 @@ impl sp_runtime::BuildStorage for RococoGenesisExt {
|
||||
fn assimilate_storage(&self, storage: &mut sp_core::storage::Storage) -> Result<(), String> {
|
||||
sp_state_machine::BasicExternalities::execute_with_storage(storage, || {
|
||||
if let Some(length) = self.session_length_in_blocks.as_ref() {
|
||||
rococo::constants::time::EpochDurationInBlocks::set(length);
|
||||
rococo_runtime_constants::time::EpochDurationInBlocks::set(length);
|
||||
}
|
||||
});
|
||||
self.runtime_genesis_config.assimilate_storage(storage)
|
||||
|
||||
@@ -23,6 +23,7 @@ polkadot-service = { path = "../../service" }
|
||||
polkadot-node-subsystem = { path = "../../subsystem" }
|
||||
polkadot-node-primitives = { path = "../../primitives" }
|
||||
polkadot-test-runtime = { path = "../../../runtime/test-runtime" }
|
||||
test-runtime-constants = { path = "../../../runtime/test-runtime/constants" }
|
||||
polkadot-runtime-parachains = { path = "../../../runtime/parachains" }
|
||||
|
||||
# Substrate dependencies
|
||||
|
||||
@@ -21,11 +21,12 @@ use grandpa::AuthorityId as GrandpaId;
|
||||
use pallet_staking::Forcing;
|
||||
use polkadot_primitives::v1::{AccountId, AssignmentId, ValidatorId, MAX_CODE_SIZE, MAX_POV_SIZE};
|
||||
use polkadot_service::chain_spec::{get_account_id_from_seed, get_from_seed, Extensions};
|
||||
use polkadot_test_runtime::{constants::currency::DOTS, BABE_GENESIS_EPOCH_CONFIG};
|
||||
use polkadot_test_runtime::BABE_GENESIS_EPOCH_CONFIG;
|
||||
use sc_chain_spec::{ChainSpec, ChainType};
|
||||
use sp_authority_discovery::AuthorityId as AuthorityDiscoveryId;
|
||||
use sp_core::sr25519;
|
||||
use sp_runtime::Perbill;
|
||||
use test_runtime_constants::currency::DOTS;
|
||||
|
||||
const DEFAULT_PROTOCOL_ID: &str = "dot";
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ smallvec = "1.6.1"
|
||||
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
beefy-primitives = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
kusama-runtime-constants = { package = "kusama-runtime-constants", path = "./constants", default-features = false }
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
offchain-primitives = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -171,6 +172,7 @@ std = [
|
||||
"frame-try-runtime/std",
|
||||
"sp-npos-elections/std",
|
||||
"beefy-primitives/std",
|
||||
"kusama-runtime-constants/std",
|
||||
"pallet-mmr-primitives/std",
|
||||
"xcm/std",
|
||||
"xcm-executor/std",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "kusama-runtime-constants"
|
||||
version = "0.9.13"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6.1"
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-runtime/std"
|
||||
]
|
||||
+1
@@ -14,6 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::v0::Balance;
|
||||
@@ -98,8 +98,7 @@ pub use pallet_timestamp::Call as TimestampCall;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
use constants::{currency::*, fee::*, time::*};
|
||||
use kusama_runtime_constants::{currency::*, fee::*, time::*};
|
||||
|
||||
// Weights used in the runtime.
|
||||
mod weights;
|
||||
|
||||
@@ -63,6 +63,7 @@ pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "ma
|
||||
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
polkadot-runtime-constants = { package = "polkadot-runtime-constants", path = "./constants", default-features = false }
|
||||
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -151,6 +152,7 @@ std = [
|
||||
"sp-staking/std",
|
||||
"frame-system/std",
|
||||
"frame-system-rpc-runtime-api/std",
|
||||
"polkadot-runtime-constants/std",
|
||||
"sp-version/std",
|
||||
"serde_derive",
|
||||
"serde/std",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "polkadot-runtime-constants"
|
||||
version = "0.9.13"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6.1"
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-runtime/std"
|
||||
]
|
||||
+4
@@ -14,6 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
pub use self::currency::DOLLARS;
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::v0::Balance;
|
||||
@@ -100,8 +100,7 @@ pub use pallet_timestamp::Call as TimestampCall;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
use constants::{currency::*, fee::*, time::*};
|
||||
use polkadot_runtime_constants::{currency::*, fee::*, time::*};
|
||||
|
||||
// Weights used in the runtime.
|
||||
mod weights;
|
||||
|
||||
@@ -58,6 +58,7 @@ authority-discovery-primitives = { package = "sp-authority-discovery", git = "ht
|
||||
|
||||
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
rococo-runtime-constants = { package = "rococo-runtime-constants", path = "./constants", default-features = false }
|
||||
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../primitives", default-features = false }
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "rococo-runtime-constants"
|
||||
version = "0.9.13"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6.1"
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-runtime/std"
|
||||
]
|
||||
+2
@@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::v0::Balance;
|
||||
@@ -39,6 +39,8 @@ use frame_support::{
|
||||
};
|
||||
use sp_std::{convert::TryFrom, marker::PhantomData, ops::RangeInclusive};
|
||||
|
||||
use rococo_runtime_constants::fee::WeightToFee;
|
||||
|
||||
/// Maximal number of pending outbound messages.
|
||||
const MAXIMAL_PENDING_MESSAGES_AT_OUTBOUND_LANE: MessageNonce =
|
||||
bp_rococo::MAX_UNCONFIRMED_MESSAGES_AT_INBOUND_LANE;
|
||||
@@ -138,7 +140,7 @@ impl<B, GI> ThisChainWithMessages for RococoLikeChain<B, GI> {
|
||||
.base_extrinsic,
|
||||
crate::TransactionByteFee::get(),
|
||||
pallet_transaction_payment::Pallet::<crate::Runtime>::next_fee_multiplier(),
|
||||
|weight| crate::constants::fee::WeightToFee::calc(&weight),
|
||||
|weight| WeightToFee::calc(&weight),
|
||||
transaction,
|
||||
)
|
||||
}
|
||||
@@ -195,7 +197,7 @@ impl<B, GI> BridgedChainWithMessages for RococoLikeChain<B, GI> {
|
||||
.base_extrinsic,
|
||||
crate::TransactionByteFee::get(),
|
||||
pallet_transaction_payment::Pallet::<crate::Runtime>::next_fee_multiplier(),
|
||||
|weight| crate::constants::fee::WeightToFee::calc(&weight),
|
||||
|weight| WeightToFee::calc(&weight),
|
||||
transaction,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -81,7 +81,9 @@ pub use pallet_balances::Call as BalancesCall;
|
||||
|
||||
use polkadot_parachain::primitives::Id as ParaId;
|
||||
|
||||
use constants::{currency::*, fee::*, time::*};
|
||||
/// Constant values used within the runtime.
|
||||
use rococo_runtime_constants::{currency::*, fee::*, time::*};
|
||||
|
||||
use frame_support::traits::{InstanceFilter, OnRuntimeUpgrade};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
@@ -93,8 +95,6 @@ use xcm_builder::{
|
||||
use xcm_executor::XcmExecutor;
|
||||
|
||||
mod bridge_messages;
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
mod validator_manager;
|
||||
mod weights;
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "ma
|
||||
pallet-staking-reward-curve = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
test-runtime-constants = { package = "test-runtime-constants", path = "./constants", default-features = false }
|
||||
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -114,6 +115,7 @@ std = [
|
||||
"pallet-staking/std",
|
||||
"frame-system/std",
|
||||
"frame-system-rpc-runtime-api/std",
|
||||
"test-runtime-constants/std",
|
||||
"pallet-timestamp/std",
|
||||
"sp-version/std",
|
||||
"pallet-vesting/std",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "test-runtime-constants"
|
||||
version = "0.9.13"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6.1"
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-runtime/std"
|
||||
]
|
||||
+2
@@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::v0::Balance;
|
||||
@@ -81,9 +81,8 @@ pub use paras_sudo_wrapper::Call as ParasSudoWrapperCall;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
use test_runtime_constants::{currency::*, fee::*, time::*};
|
||||
pub mod xcm_config;
|
||||
use constants::{currency::*, fee::*, time::*};
|
||||
|
||||
// Make the WASM binary available.
|
||||
#[cfg(feature = "std")]
|
||||
|
||||
@@ -37,6 +37,7 @@ frame-executive = { git = "https://github.com/paritytech/substrate", branch = "m
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
westend-runtime-constants = { package = "westend-runtime-constants", path = "./constants", default-features = false }
|
||||
pallet-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-authorship = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
@@ -157,6 +158,7 @@ std = [
|
||||
"sp-staking/std",
|
||||
"frame-system/std",
|
||||
"frame-system-rpc-runtime-api/std",
|
||||
"westend-runtime-constants/std",
|
||||
"sp-version/std",
|
||||
"serde_derive",
|
||||
"serde/std",
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
[package]
|
||||
name = "westend-runtime-constants"
|
||||
version = "0.9.13"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
smallvec = "1.6.1"
|
||||
|
||||
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
primitives = { package = "polkadot-primitives", path = "../../../primitives", default-features = false }
|
||||
runtime-common = { package = "polkadot-runtime-common", path = "../../common", default-features = false }
|
||||
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-runtime/std"
|
||||
]
|
||||
+2
@@ -14,6 +14,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
/// Money matters.
|
||||
pub mod currency {
|
||||
use primitives::v0::Balance;
|
||||
@@ -98,8 +98,7 @@ pub use pallet_timestamp::Call as TimestampCall;
|
||||
pub use sp_runtime::BuildStorage;
|
||||
|
||||
/// Constant values used within the runtime.
|
||||
pub mod constants;
|
||||
use constants::{currency::*, fee::*, time::*};
|
||||
use westend_runtime_constants::{currency::*, fee::*, time::*};
|
||||
|
||||
// Weights used in the runtime
|
||||
mod weights;
|
||||
|
||||
@@ -5,9 +5,13 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
polkadot-runtime = { version = "0.9.8", path = "../../../runtime/polkadot" }
|
||||
kusama-runtime = { version = "0.9.8", path = "../../../runtime/kusama" }
|
||||
westend-runtime = { version = "0.9.8", path = "../../../runtime/westend" }
|
||||
polkadot-runtime = { version = "0.9.13", path = "../../../runtime/polkadot" }
|
||||
kusama-runtime = { version = "0.9.13", path = "../../../runtime/kusama" }
|
||||
westend-runtime = { version = "0.9.13", path = "../../../runtime/westend" }
|
||||
polkadot-runtime-constants = { version = "0.9.13", path = "../../../runtime/polkadot/constants" }
|
||||
kusama-runtime-constants = { version = "0.9.13", path = "../../../runtime/kusama/constants" }
|
||||
westend-runtime-constants = { version = "0.9.13", path = "../../../runtime/westend/constants" }
|
||||
|
||||
|
||||
pallet-bags-list-remote-tests = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
@@ -83,15 +83,18 @@ async fn main() {
|
||||
|
||||
match (options.runtime, options.command) {
|
||||
(Runtime::Kusama, Command::CheckMigration) => {
|
||||
use kusama_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
migration::execute::<Runtime, Block>(UNITS as u64, "KSM", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Kusama, Command::SanityCheck) => {
|
||||
use kusama_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
sanity_check::execute::<Runtime, Block>(UNITS as u64, "KSM", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Kusama, Command::Snapshot) => {
|
||||
use kusama_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use kusama_runtime::{Block, Runtime};
|
||||
use kusama_runtime_constants::currency::UNITS;
|
||||
snapshot::execute::<Runtime, Block>(
|
||||
options.snapshot_limit,
|
||||
UNITS.try_into().unwrap(),
|
||||
@@ -101,15 +104,18 @@ async fn main() {
|
||||
},
|
||||
|
||||
(Runtime::Westend, Command::CheckMigration) => {
|
||||
use westend_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use westend_runtime::{Block, Runtime};
|
||||
use westend_runtime_constants::currency::UNITS;
|
||||
migration::execute::<Runtime, Block>(UNITS as u64, "WND", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Westend, Command::SanityCheck) => {
|
||||
use westend_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use westend_runtime::{Block, Runtime};
|
||||
use westend_runtime_constants::currency::UNITS;
|
||||
sanity_check::execute::<Runtime, Block>(UNITS as u64, "WND", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Westend, Command::Snapshot) => {
|
||||
use westend_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use westend_runtime::{Block, Runtime};
|
||||
use westend_runtime_constants::currency::UNITS;
|
||||
snapshot::execute::<Runtime, Block>(
|
||||
options.snapshot_limit,
|
||||
UNITS.try_into().unwrap(),
|
||||
@@ -119,15 +125,18 @@ async fn main() {
|
||||
},
|
||||
|
||||
(Runtime::Polkadot, Command::CheckMigration) => {
|
||||
use polkadot_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
migration::execute::<Runtime, Block>(UNITS as u64, "DOT", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Polkadot, Command::SanityCheck) => {
|
||||
use polkadot_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
sanity_check::execute::<Runtime, Block>(UNITS as u64, "DOT", options.uri.clone()).await;
|
||||
},
|
||||
(Runtime::Polkadot, Command::Snapshot) => {
|
||||
use polkadot_runtime::{constants::currency::UNITS, Block, Runtime};
|
||||
use polkadot_runtime::{Block, Runtime};
|
||||
use polkadot_runtime_constants::currency::UNITS;
|
||||
snapshot::execute::<Runtime, Block>(
|
||||
options.snapshot_limit,
|
||||
UNITS.try_into().unwrap(),
|
||||
|
||||
Reference in New Issue
Block a user