From 7f0eb5f06e4a403b10be1f7893859dde79f4d813 Mon Sep 17 00:00:00 2001 From: Juan Date: Wed, 23 Aug 2023 13:39:43 +0200 Subject: [PATCH] Companion: restructure macro related exports (#7626) * move RuntimeDebug out of frame_support * move RuntimeDebug out of frame_support * fix xcm export * ".git/.scripts/commands/fmt/fmt.sh" * fix xcm intefration tests * fix cargo lock for xcm intefration tests * wip * restructure benchmarking macro related exports * update cargo lock --------- Co-authored-by: parity-processbot <> --- Cargo.lock | 5 +++++ runtime/kusama/Cargo.toml | 1 + runtime/kusama/src/lib.rs | 7 ++++--- runtime/polkadot/Cargo.toml | 1 + runtime/polkadot/src/lib.rs | 7 ++++--- runtime/rococo/Cargo.toml | 1 + runtime/rococo/src/lib.rs | 7 ++++--- runtime/westend/Cargo.toml | 1 + runtime/westend/src/lib.rs | 3 ++- xcm/xcm-executor/integration-tests/Cargo.toml | 1 + xcm/xcm-executor/integration-tests/src/lib.rs | 3 ++- xcm/xcm-simulator/example/src/lib.rs | 2 +- 12 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b19bc139384..61f838f8c35e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4387,6 +4387,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -8405,6 +8406,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -9834,6 +9836,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-trie", @@ -14745,6 +14748,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-tracing", "sp-transaction-pool", "sp-version", @@ -15184,6 +15188,7 @@ dependencies = [ "frame-system", "futures", "pallet-xcm", + "parity-scale-codec", "polkadot-test-client", "polkadot-test-runtime", "polkadot-test-service", diff --git a/runtime/kusama/Cargo.toml b/runtime/kusama/Cargo.toml index a88654d26121..3a253f47dde6 100644 --- a/runtime/kusama/Cargo.toml +++ b/runtime/kusama/Cargo.toml @@ -34,6 +34,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 3d6a56cfecbd..e9e3fb2d2026 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -67,7 +67,7 @@ use frame_support::{ PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -82,7 +82,7 @@ use sp_runtime::{ Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -2330,7 +2330,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/runtime/polkadot/Cargo.toml b/runtime/polkadot/Cargo.toml index 5d343811fb14..76a01051a122 100644 --- a/runtime/polkadot/Cargo.toml +++ b/runtime/polkadot/Cargo.toml @@ -33,6 +33,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index dca0d0d986da..c4458076cb3d 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -51,7 +51,7 @@ use frame_support::{ ProcessMessage, ProcessMessageError, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -78,7 +78,7 @@ use sp_runtime::{ OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*}; @@ -2077,7 +2077,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/runtime/rococo/Cargo.toml b/runtime/rococo/Cargo.toml index 95791edda710..527bc1af9ccc 100644 --- a/runtime/rococo/Cargo.toml +++ b/runtime/rococo/Cargo.toml @@ -30,6 +30,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 145b25d8aa9a..6894bd7bbf44 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -64,7 +64,7 @@ use frame_support::{ PrivilegeCmp, ProcessMessage, ProcessMessageError, StorageMapShim, WithdrawReasons, }, weights::{ConstantMultiplier, WeightMeter}, - PalletId, RuntimeDebug, + PalletId, }; use frame_system::EnsureRoot; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; @@ -79,7 +79,7 @@ use sp_runtime::{ Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, + ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, }; use sp_staking::SessionIndex; #[cfg(any(feature = "std", test))] @@ -2114,9 +2114,10 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; use frame_system_benchmarking::Pallet as SystemBench; use frame_benchmarking::baseline::Pallet as Baseline; + use sp_storage::TrackedStorageKey; use xcm::latest::prelude::*; use xcm_config::{ LocalCheckAccount, LocationConverter, Rockmine, TokenLocation, XcmConfig, diff --git a/runtime/westend/Cargo.toml b/runtime/westend/Cargo.toml index a0b13145578d..0231198ba820 100644 --- a/runtime/westend/Cargo.toml +++ b/runtime/westend/Cargo.toml @@ -31,6 +31,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } +sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-version = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 62770e0992fb..9ae30c376010 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -2006,7 +2006,8 @@ sp_api::impl_runtime_apis! { sp_runtime::RuntimeString, > { use frame_support::traits::WhitelistedStorageKeys; - use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, BenchmarkError}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, BenchmarkError}; + use sp_storage::TrackedStorageKey; // Trying to add benchmarks directly to some pallets caused cyclic dependency issues. // To get around that, we separated the benchmarks into its own crate. use pallet_session_benchmarking::Pallet as SessionBench; diff --git a/xcm/xcm-executor/integration-tests/Cargo.toml b/xcm/xcm-executor/integration-tests/Cargo.toml index 18a729e082d2..cec9754baa31 100644 --- a/xcm/xcm-executor/integration-tests/Cargo.toml +++ b/xcm/xcm-executor/integration-tests/Cargo.toml @@ -8,6 +8,7 @@ version.workspace = true publish = false [dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1" } frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master" } futures = "0.3.21" diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 111833e67cfb..d8c77f8317e1 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,7 +17,8 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] -use frame_support::{codec::Encode, dispatch::GetDispatchInfo, weights::Weight}; +use codec::Encode; +use frame_support::{dispatch::GetDispatchInfo, weights::Weight}; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, diff --git a/xcm/xcm-simulator/example/src/lib.rs b/xcm/xcm-simulator/example/src/lib.rs index 1f6956485a84..85b8ad1c5cb7 100644 --- a/xcm/xcm-simulator/example/src/lib.rs +++ b/xcm/xcm-simulator/example/src/lib.rs @@ -17,8 +17,8 @@ mod parachain; mod relay_chain; -use frame_support::sp_tracing; use sp_runtime::BuildStorage; +use sp_tracing; use xcm::prelude::*; use xcm_executor::traits::ConvertLocation; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt};