From 5a4c4da1b78b1d20bf7d194e998ec1da11b5e9b1 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Fri, 4 Aug 2023 11:14:51 +1200 Subject: [PATCH 1/3] update --- Cargo.dev.toml | 126 ++++++++++++++++++------------------ asset-registry/src/lib.rs | 5 +- auction/src/lib.rs | 31 +++++---- authority/src/lib.rs | 22 +++---- bencher/test/src/lib.rs | 2 +- currencies/src/lib.rs | 6 +- gradually-update/src/lib.rs | 16 ++--- nft/src/lib.rs | 7 +- oracle/src/lib.rs | 6 +- payments/README.md | 10 +-- payments/src/lib.rs | 8 +-- payments/src/types.rs | 3 +- rewards/src/lib.rs | 6 -- tokens/src/lib.rs | 8 +-- unknown-tokens/src/lib.rs | 6 -- vesting/src/lib.rs | 14 ++-- vesting/src/mock.rs | 2 +- weight-meter/src/mock.rs | 2 +- xtokens/src/lib.rs | 2 +- 19 files changed, 137 insertions(+), 145 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 36a45c60b..261190391 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -37,70 +37,70 @@ resolver = "2" split-debuginfo = "unpacked" [patch.'https://github.com/paritytech/substrate'] -frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -frame-support = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -frame-system = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-babe = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-session = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -pallet-transaction-payment = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sc-executor = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sc-utils = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-api = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-consensus-slots = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-core = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-io = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-session = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-staking = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-std = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-storage = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-trie = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-version = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-tracing = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-maybe-compressed-blob = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } -sp-weights = { git = "https://github.com/paritytech//substrate", rev = "6d28d2eb6fa1589105e970ff1b97555d91a1495b" } +frame-benchmarking = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +frame-support = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +frame-system = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-authorship = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-babe = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-balances = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-elections-phragmen = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-scheduler = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-session = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-staking = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-timestamp = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-treasury = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-vesting = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +pallet-transaction-payment = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sc-client-api = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sc-client-db = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sc-executor = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sc-executor-common = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sc-utils = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-api = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-application-crypto = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-arithmetic = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-authority-discovery = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-blockchain = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-consensus = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-consensus-slots = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-core = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-debug-derive = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-externalities = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-inherents = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-io = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-keystore = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-npos-elections = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-panic-handler = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-runtime = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-runtime-interface = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-session = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-staking = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-state-machine = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-std = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-storage = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-timestamp = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-trie = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-version = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-wasm-interface = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-tracing = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } +sp-weights = { git = "https://github.com/paritytech//substrate", rev = "948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" } [patch.'https://github.com/paritytech/cumulus'] -cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "a188eb95c522f3ca4c43ef7fed19a6107224217c" } -cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "a188eb95c522f3ca4c43ef7fed19a6107224217c" } -cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "a188eb95c522f3ca4c43ef7fed19a6107224217c" } -cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "a188eb95c522f3ca4c43ef7fed19a6107224217c" } -parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "a188eb95c522f3ca4c43ef7fed19a6107224217c" } +cumulus-primitives-core = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf6bef320f156f2859d6d2b0abd4154ae1d5" } +cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf6bef320f156f2859d6d2b0abd4154ae1d5" } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf6bef320f156f2859d6d2b0abd4154ae1d5" } +cumulus-pallet-xcm = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf6bef320f156f2859d6d2b0abd4154ae1d5" } +parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf6bef320f156f2859d6d2b0abd4154ae1d5" } [patch.'https://github.com/paritytech/polkadot'] -pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -xcm = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } -xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" } +pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +xcm = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +xcm-executor = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +xcm-builder = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +xcm-simulator = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } diff --git a/asset-registry/src/lib.rs b/asset-registry/src/lib.rs index bcc3fdd29..236a8cd04 100644 --- a/asset-registry/src/lib.rs +++ b/asset-registry/src/lib.rs @@ -120,7 +120,7 @@ pub mod module { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { self.assets.iter().for_each(|(asset_id, metadata_encoded)| { let metadata = AssetMetadata::decode(&mut &metadata_encoded[..]).expect("Error decoding AssetMetadata"); @@ -139,9 +139,6 @@ pub mod module { #[pallet::without_storage_info] pub struct Pallet(_); - #[pallet::hooks] - impl Hooks for Pallet {} - #[pallet::call] impl Pallet { #[pallet::call_index(0)] diff --git a/auction/src/lib.rs b/auction/src/lib.rs index 476863853..bf5d86463 100644 --- a/auction/src/lib.rs +++ b/auction/src/lib.rs @@ -59,7 +59,7 @@ pub mod module { /// The `AuctionHandler` that allow custom bidding logic and handles /// auction result. - type Handler: AuctionHandler; + type Handler: AuctionHandler, Self::AuctionId>; /// Weight information for extrinsics in this module. type WeightInfo: WeightInfo; @@ -88,8 +88,13 @@ pub mod module { /// Stores on-going and future auctions. Closed auction are removed. #[pallet::storage] #[pallet::getter(fn auctions)] - pub type Auctions = - StorageMap<_, Twox64Concat, T::AuctionId, AuctionInfo, OptionQuery>; + pub type Auctions = StorageMap< + _, + Twox64Concat, + T::AuctionId, + AuctionInfo>, + OptionQuery, + >; /// Track the next auction ID. #[pallet::storage] @@ -100,18 +105,18 @@ pub mod module { #[pallet::storage] #[pallet::getter(fn auction_end_time)] pub type AuctionEndTime = - StorageDoubleMap<_, Twox64Concat, T::BlockNumber, Blake2_128Concat, T::AuctionId, (), OptionQuery>; + StorageDoubleMap<_, Twox64Concat, BlockNumberFor, Blake2_128Concat, T::AuctionId, (), OptionQuery>; #[pallet::pallet] pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet { - fn on_initialize(now: T::BlockNumber) -> Weight { + impl Hooks> for Pallet { + fn on_initialize(now: BlockNumberFor) -> Weight { T::WeightInfo::on_finalize(AuctionEndTime::::iter_prefix(now).count() as u32) } - fn on_finalize(now: T::BlockNumber) { + fn on_finalize(now: BlockNumberFor) { for (auction_id, _) in AuctionEndTime::::drain_prefix(now) { if let Some(auction) = Auctions::::take(auction_id) { T::Handler::on_auction_ended(auction_id, auction.bid); @@ -132,7 +137,7 @@ pub mod module { let from = ensure_signed(origin)?; Auctions::::try_mutate_exists(id, |auction| -> DispatchResult { - let mut auction = auction.as_mut().ok_or(Error::::AuctionNotExist)?; + let auction = auction.as_mut().ok_or(Error::::AuctionNotExist)?; let block_number = >::block_number(); @@ -174,17 +179,17 @@ pub mod module { } } -impl Auction for Pallet { +impl Auction> for Pallet { type AuctionId = T::AuctionId; type Balance = T::Balance; - fn auction_info(id: Self::AuctionId) -> Option> { + fn auction_info(id: Self::AuctionId) -> Option>> { Self::auctions(id) } fn update_auction( id: Self::AuctionId, - info: AuctionInfo, + info: AuctionInfo>, ) -> DispatchResult { let auction = Auctions::::get(id).ok_or(Error::::AuctionNotExist)?; if let Some(old_end) = auction.end { @@ -198,8 +203,8 @@ impl Auction for Pallet { } fn new_auction( - start: T::BlockNumber, - end: Option, + start: BlockNumberFor, + end: Option>, ) -> sp_std::result::Result { let auction = AuctionInfo { bid: None, start, end }; let auction_id = diff --git a/authority/src/lib.rs b/authority/src/lib.rs index db94411ea..64921151d 100644 --- a/authority/src/lib.rs +++ b/authority/src/lib.rs @@ -193,7 +193,7 @@ pub mod module { /// Origin for the authority module. #[pallet::origin] - pub type Origin = DelayedOrigin<::BlockNumber, ::PalletsOrigin>; + pub type Origin = DelayedOrigin, ::PalletsOrigin>; pub(crate) type CallOf = ::RuntimeCall; #[pallet::config] @@ -202,7 +202,7 @@ pub mod module { type RuntimeEvent: From> + IsType<::RuntimeEvent>; /// The outer origin type. - type RuntimeOrigin: From::PalletsOrigin>> + type RuntimeOrigin: From, ::PalletsOrigin>> + IsType<::RuntimeOrigin> + OriginTrait; @@ -215,7 +215,7 @@ pub mod module { + GetDispatchInfo; /// The Scheduler. - type Scheduler: ScheduleNamed::RuntimeCall, Self::PalletsOrigin>; + type Scheduler: ScheduleNamed, ::RuntimeCall, Self::PalletsOrigin>; /// The type represent origin that can be dispatched by other origins. type AsOriginId: Parameter + AsOriginId<::RuntimeOrigin, Self::PalletsOrigin>; @@ -224,7 +224,7 @@ pub mod module { type AuthorityConfig: AuthorityConfig< ::RuntimeOrigin, Self::PalletsOrigin, - Self::BlockNumber, + BlockNumberFor, >; /// Weight information for extrinsics in this module. @@ -263,13 +263,13 @@ pub mod module { FastTracked { origin: T::PalletsOrigin, index: ScheduleTaskIndex, - when: T::BlockNumber, + when: BlockNumberFor, }, /// A scheduled call is delayed. Delayed { origin: T::PalletsOrigin, index: ScheduleTaskIndex, - when: T::BlockNumber, + when: BlockNumberFor, }, /// A scheduled call is cancelled. Cancelled { @@ -300,7 +300,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { @@ -327,7 +327,7 @@ pub mod module { #[pallet::weight(T::WeightInfo::schedule_dispatch_without_delay())] pub fn schedule_dispatch( origin: OriginFor, - when: DispatchTime, + when: DispatchTime>, priority: Priority, with_delayed_origin: bool, call: Box>, @@ -347,7 +347,7 @@ pub mod module { let schedule_origin = if with_delayed_origin { let origin: ::RuntimeOrigin = From::from(origin); let origin: ::RuntimeOrigin = - From::from(DelayedOrigin:: { + From::from(DelayedOrigin::, T::PalletsOrigin> { delay, origin: Box::new(origin.caller().clone()), }); @@ -381,7 +381,7 @@ pub mod module { origin: OriginFor, initial_origin: Box, task_id: ScheduleTaskIndex, - when: DispatchTime, + when: DispatchTime>, ) -> DispatchResult { let now = frame_system::Pallet::::block_number(); let new_delay = match when { @@ -412,7 +412,7 @@ pub mod module { origin: OriginFor, initial_origin: Box, task_id: ScheduleTaskIndex, - additional_delay: T::BlockNumber, + additional_delay: BlockNumberFor, ) -> DispatchResult { T::AuthorityConfig::check_delay_schedule(origin, &initial_origin)?; diff --git a/bencher/test/src/lib.rs b/bencher/test/src/lib.rs index c2acf19a1..15646b4ba 100644 --- a/bencher/test/src/lib.rs +++ b/bencher/test/src/lib.rs @@ -18,7 +18,7 @@ pub mod pallet { pub trait Config: frame_system::Config {} #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] pub struct Pallet(PhantomData); diff --git a/currencies/src/lib.rs b/currencies/src/lib.rs index a7594f9c4..f690c2718 100644 --- a/currencies/src/lib.rs +++ b/currencies/src/lib.rs @@ -118,7 +118,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { @@ -285,7 +285,7 @@ impl MultiCurrencyExtended for Pallet { } impl MultiLockableCurrency for Pallet { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; fn set_lock( lock_id: LockIdentifier, @@ -515,7 +515,7 @@ where T: Config, GetCurrencyId: Get>, { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; fn set_lock(lock_id: LockIdentifier, who: &T::AccountId, amount: Self::Balance) -> DispatchResult { as MultiLockableCurrency>::set_lock(lock_id, GetCurrencyId::get(), who, amount) diff --git a/gradually-update/src/lib.rs b/gradually-update/src/lib.rs index 0371b0fa2..36d7d6e1c 100644 --- a/gradually-update/src/lib.rs +++ b/gradually-update/src/lib.rs @@ -73,7 +73,7 @@ pub mod module { /// The frequency of updating values between blocks #[pallet::constant] - type UpdateFrequency: Get; + type UpdateFrequency: Get>; /// The origin that can schedule an update type DispatchOrigin: EnsureOrigin; @@ -122,7 +122,7 @@ pub mod module { GraduallyUpdateCancelled { key: StorageKeyBytes }, /// Gradually update applied. Updated { - block_number: T::BlockNumber, + block_number: BlockNumberFor, key: StorageKeyBytes, target_value: StorageValueBytes, }, @@ -137,15 +137,15 @@ pub mod module { /// The last updated block number #[pallet::storage] #[pallet::getter(fn last_updated_at)] - pub(crate) type LastUpdatedAt = StorageValue<_, T::BlockNumber, ValueQuery>; + pub(crate) type LastUpdatedAt = StorageValue<_, BlockNumberFor, ValueQuery>; #[pallet::pallet] pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet { + impl Hooks> for Pallet { /// `on_initialize` to return the weight used in `on_finalize`. - fn on_initialize(now: T::BlockNumber) -> Weight { + fn on_initialize(now: BlockNumberFor) -> Weight { if Self::_need_update(now) { T::WeightInfo::on_finalize(GraduallyUpdates::::get().len() as u32) } else { @@ -154,7 +154,7 @@ pub mod module { } /// Update gradually_update to adjust numeric parameter. - fn on_finalize(now: T::BlockNumber) { + fn on_finalize(now: BlockNumberFor) { Self::_on_finalize(now); } } @@ -224,11 +224,11 @@ pub mod module { } impl Pallet { - fn _need_update(now: T::BlockNumber) -> bool { + fn _need_update(now: BlockNumberFor) -> bool { now >= Self::last_updated_at().saturating_add(T::UpdateFrequency::get()) } - fn _on_finalize(now: T::BlockNumber) { + fn _on_finalize(now: BlockNumberFor) { if !Self::_need_update(now) { return; } diff --git a/nft/src/lib.rs b/nft/src/lib.rs index 92cd9612a..b6af89175 100644 --- a/nft/src/lib.rs +++ b/nft/src/lib.rs @@ -23,6 +23,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ensure, pallet_prelude::*, traits::Get, BoundedVec, Parameter}; +use frame_system::pallet_prelude::*; use scale_info::TypeInfo; use sp_runtime::{ traits::{AtLeast32BitUnsigned, CheckedAdd, CheckedSub, MaybeSerializeDeserialize, Member, One, Zero}, @@ -175,7 +176,7 @@ pub mod module { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { self.tokens.iter().for_each(|token_class| { let class_id = Pallet::::create_class(&token_class.0, token_class.1.to_vec(), token_class.2.clone()) @@ -193,7 +194,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet {} @@ -229,7 +230,7 @@ impl Pallet { /// Transfer NFT(non fungible token) from `from` account to `to` account pub fn transfer(from: &T::AccountId, to: &T::AccountId, token: (T::ClassId, T::TokenId)) -> DispatchResult { Tokens::::try_mutate(token.0, token.1, |token_info| -> DispatchResult { - let mut info = token_info.as_mut().ok_or(Error::::TokenNotFound)?; + let info = token_info.as_mut().ok_or(Error::::TokenNotFound)?; ensure!(info.owner == *from, Error::::NoPermission); if from == to { // no change needed diff --git a/oracle/src/lib.rs b/oracle/src/lib.rs index 6b63769f4..13b5fd280 100644 --- a/oracle/src/lib.rs +++ b/oracle/src/lib.rs @@ -141,13 +141,13 @@ pub mod module { pub struct Pallet(PhantomData<(T, I)>); #[pallet::hooks] - impl, I: 'static> Hooks for Pallet { + impl, I: 'static> Hooks> for Pallet { /// `on_initialize` to return the weight used in `on_finalize`. - fn on_initialize(_n: T::BlockNumber) -> Weight { + fn on_initialize(_n: BlockNumberFor) -> Weight { T::WeightInfo::on_finalize() } - fn on_finalize(_n: T::BlockNumber) { + fn on_finalize(_n: BlockNumberFor) { // cleanup for next block >::kill(); } diff --git a/payments/README.md b/payments/README.md index e28fbf26c..1ffd8d9a8 100644 --- a/payments/README.md +++ b/payments/README.md @@ -1,6 +1,6 @@ # Payments Pallet -This pallet allows users to create secure reversible payments that keep funds locked in a merchant's account until the off-chain goods are confirmed to be received. Each payment gets assigned its own *judge* that can help resolve any disputes between the two parties. +This pallet allows users to create secure reversible payments that keep funds locked in a merchant's account until the off-chain goods are confirmed to be received. Each payment gets assigned its own *judge* that can help resolve any disputes between the two parties. ## Terminology @@ -18,7 +18,7 @@ This pallet allows users to create secure reversible payments that keep funds lo - `PaymentCreated { from: T::AccountId, asset: AssetIdOf, amount: BalanceOf },`, - `PaymentReleased { from: T::AccountId, to: T::AccountId }`, - `PaymentCancelled { from: T::AccountId, to: T::AccountId }`, -- `PaymentCreatorRequestedRefund { from: T::AccountId, to: T::AccountId, expiry: T::BlockNumber}` +- `PaymentCreatorRequestedRefund { from: T::AccountId, to: T::AccountId, expiry: BlockNumberFor}` - `PaymentRefundDisputed { from: T::AccountId, to: T::AccountId }` - `PaymentRequestCreated { from: T::AccountId, to: T::AccountId }` - `PaymentRequestCompleted { from: T::AccountId, to: T::AccountId }` @@ -42,11 +42,11 @@ This pallet allows users to create secure reversible payments that keep funds lo The RatesProvider module provides implementations for the following traits. - [`PaymentHandler`](./src/types.rs) -## Types +## Types The `PaymentDetail` struct stores information about the payment/escrow. A "payment" in virto network is similar to an escrow, it is used to guarantee proof of funds and can be released once an agreed upon condition has reached between the payment creator and recipient. The payment lifecycle is tracked using the state field. -```rust +```rust pub struct PaymentDetail { /// type of asset used for payment pub asset: AssetIdOf, @@ -55,7 +55,7 @@ pub struct PaymentDetail { /// incentive amount that is credited to creator for resolving pub incentive_amount: BalanceOf, /// enum to track payment lifecycle [Created, NeedsReview] - pub state: PaymentState, + pub state: PaymentState>, /// account that can settle any disputes created in the payment pub resolver_account: T::AccountId, /// fee charged and recipient account details diff --git a/payments/src/lib.rs b/payments/src/lib.rs index fc012e4d6..79f289fa0 100644 --- a/payments/src/lib.rs +++ b/payments/src/lib.rs @@ -87,7 +87,7 @@ pub mod pallet { pub type AssetIdOf = <::Asset as MultiCurrency<::AccountId>>::CurrencyId; pub type BoundedDataOf = BoundedVec::MaxRemarkLength>; /// type of ScheduledTask used by the pallet - pub type ScheduledTaskOf = ScheduledTask<::BlockNumber>; + pub type ScheduledTaskOf = ScheduledTask>; /// list of ScheduledTasks, stored as a BoundedBTreeMap pub type ScheduledTaskList = BoundedBTreeMap< ( @@ -118,7 +118,7 @@ pub mod pallet { /// Buffer period - number of blocks to wait before user can claim /// canceled payment #[pallet::constant] - type CancelBufferBlockLength: Get; + type CancelBufferBlockLength: Get>; /// Buffer period - number of blocks to wait before user can claim /// canceled payment #[pallet::constant] @@ -176,7 +176,7 @@ pub mod pallet { PaymentCreatorRequestedRefund { from: T::AccountId, to: T::AccountId, - expiry: T::BlockNumber, + expiry: BlockNumberFor, }, /// the refund request from creator was disputed by recipient PaymentRefundDisputed { from: T::AccountId, to: T::AccountId }, @@ -213,7 +213,7 @@ pub mod pallet { /// Hook that execute when there is leftover space in a block /// This function will look for any pending scheduled tasks that can /// be executed and will process them. - fn on_idle(now: T::BlockNumber, remaining_weight: Weight) -> Weight { + fn on_idle(now: BlockNumberFor, remaining_weight: Weight) -> Weight { const MAX_TASKS_TO_PROCESS: usize = 5; // used to read the task list let mut used_weight = T::WeightInfo::remove_task(); diff --git a/payments/src/types.rs b/payments/src/types.rs index acb694db2..ad320677b 100644 --- a/payments/src/types.rs +++ b/payments/src/types.rs @@ -1,6 +1,7 @@ #![allow(unused_qualifications)] use crate::{pallet, AssetIdOf, BalanceOf}; use codec::{Decode, Encode, HasCompact, MaxEncodedLen}; +use frame_system::pallet_prelude::*; use scale_info::TypeInfo; use sp_runtime::{DispatchResult, Percent}; @@ -44,7 +45,7 @@ pub enum PaymentState { /// A judge needs to review and release manually NeedsReview, /// The user has requested refund and will be processed by `BlockNumber` - RefundRequested { cancel_block: T::BlockNumber }, + RefundRequested { cancel_block: BlockNumberFor }, /// The recipient of this transaction has created a request PaymentRequested, } diff --git a/rewards/src/lib.rs b/rewards/src/lib.rs index b24063c39..b98d521f4 100644 --- a/rewards/src/lib.rs +++ b/rewards/src/lib.rs @@ -114,12 +114,6 @@ pub mod module { #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(_); - - #[pallet::hooks] - impl Hooks for Pallet {} - - #[pallet::call] - impl Pallet {} } impl Pallet { diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 023e70b02..2175b1b6a 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -430,7 +430,7 @@ pub mod module { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { // ensure no duplicates exist. let unique_endowed_accounts = self @@ -466,7 +466,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { @@ -1274,7 +1274,7 @@ impl MultiCurrencyExtended for Pallet { } impl MultiLockableCurrency for Pallet { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; // Set a lock on the balance of `who` under `currency_id`. // Is a no-op if lock amount is zero. @@ -2400,7 +2400,7 @@ where T: Config, GetCurrencyId: Get, { - type Moment = T::BlockNumber; + type Moment = BlockNumberFor; type MaxLocks = (); fn set_lock(id: LockIdentifier, who: &T::AccountId, amount: Self::Balance, _reasons: WithdrawReasons) { diff --git a/unknown-tokens/src/lib.rs b/unknown-tokens/src/lib.rs index c0ba1da7d..9f3608241 100644 --- a/unknown-tokens/src/lib.rs +++ b/unknown-tokens/src/lib.rs @@ -50,9 +50,6 @@ pub mod module { #[pallet::without_storage_info] pub struct Pallet(_); - #[pallet::hooks] - impl Hooks for Pallet {} - /// Concrete fungible balances under a given location and a concrete /// fungible id. /// @@ -70,9 +67,6 @@ pub mod module { #[pallet::getter(fn abstract_fungible_balances)] pub(crate) type AbstractFungibleBalances = StorageDoubleMap<_, Blake2_128Concat, MultiLocation, Blake2_128Concat, Vec, u128, ValueQuery>; - - #[pallet::call] - impl Pallet {} } impl UnknownAsset for Pallet { diff --git a/vesting/src/lib.rs b/vesting/src/lib.rs index 1db1ee397..467b78f4b 100644 --- a/vesting/src/lib.rs +++ b/vesting/src/lib.rs @@ -112,11 +112,11 @@ pub mod module { pub(crate) type BalanceOf = <::Currency as Currency<::AccountId>>::Balance; - pub(crate) type VestingScheduleOf = VestingSchedule<::BlockNumber, BalanceOf>; + pub(crate) type VestingScheduleOf = VestingSchedule, BalanceOf>; pub type ScheduledItem = ( ::AccountId, - ::BlockNumber, - ::BlockNumber, + BlockNumberFor, + BlockNumberFor, u32, BalanceOf, ); @@ -125,7 +125,7 @@ pub mod module { pub trait Config: frame_system::Config { type RuntimeEvent: From> + IsType<::RuntimeEvent>; - type Currency: LockableCurrency; + type Currency: LockableCurrency>; #[pallet::constant] /// The minimum amount transferred to call `vested_transfer`. @@ -141,7 +141,7 @@ pub mod module { type MaxVestingSchedules: Get; // The block number provider - type BlockNumberProvider: BlockNumberProvider; + type BlockNumberProvider: BlockNumberProvider>; } #[pallet::error] @@ -202,7 +202,7 @@ pub mod module { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { self.vesting .iter() @@ -241,7 +241,7 @@ pub mod module { pub struct Pallet(_); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::call] impl Pallet { diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index f692ab551..bab68748b 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -86,7 +86,7 @@ parameter_types! { impl BlockNumberProvider for MockBlockNumberProvider { type BlockNumber = u64; - fn current_block_number() -> Self::BlockNumber { + fn current_block_number() -> BlockNumberFor { Self::get() } } diff --git a/weight-meter/src/mock.rs b/weight-meter/src/mock.rs index 86e32c45d..b553e03fe 100644 --- a/weight-meter/src/mock.rs +++ b/weight-meter/src/mock.rs @@ -10,7 +10,7 @@ pub mod test_module { pub struct Pallet(PhantomData); #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::storage] #[pallet::getter(fn something)] diff --git a/xtokens/src/lib.rs b/xtokens/src/lib.rs index 1ffb04dfb..bc9621017 100644 --- a/xtokens/src/lib.rs +++ b/xtokens/src/lib.rs @@ -191,7 +191,7 @@ pub mod module { } #[pallet::hooks] - impl Hooks for Pallet {} + impl Hooks> for Pallet {} #[pallet::pallet] pub struct Pallet(_); From 08528ee15c219255f95474d3ff8f8e5176b4a04b Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Fri, 4 Aug 2023 14:57:53 +1200 Subject: [PATCH 2/3] fix --- Cargo.dev.toml | 1 + asset-registry/src/mock/mod.rs | 16 +++++----- asset-registry/src/mock/para.rs | 41 +++++++++++--------------- asset-registry/src/mock/relay.rs | 24 ++++++--------- auction/src/mock.rs | 22 +++++--------- authority/src/mock.rs | 29 +++++++----------- bencher/test/src/mock.rs | 20 +++++-------- benchmarking/src/tests.rs | 20 +++++-------- currencies/src/mock.rs | 27 +++++++---------- gradually-update/src/mock.rs | 23 +++++---------- nft/src/mock.rs | 23 +++++---------- oracle/src/mock.rs | 20 +++++-------- payments/src/mock.rs | 25 ++++++---------- rewards/src/mock.rs | 23 +++++---------- tokens/src/mock.rs | 33 +++++++++------------ unknown-tokens/src/mock.rs | 22 +++++--------- utilities/src/lib.rs | 14 +++------ vesting/src/mock.rs | 26 +++++++--------- weight-meter/src/mock.rs | 26 ++++++---------- xtokens/src/mock/mod.rs | 26 ++++++++-------- xtokens/src/mock/para.rs | 39 ++++++++++-------------- xtokens/src/mock/para_relative_view.rs | 39 ++++++++++-------------- xtokens/src/mock/para_teleport.rs | 39 ++++++++++-------------- xtokens/src/mock/relay.rs | 24 ++++++--------- 24 files changed, 235 insertions(+), 367 deletions(-) diff --git a/Cargo.dev.toml b/Cargo.dev.toml index 261190391..40798380f 100644 --- a/Cargo.dev.toml +++ b/Cargo.dev.toml @@ -98,6 +98,7 @@ parachain-info = { git = "https://github.com/paritytech//cumulus", rev = "0d17cf pallet-xcm = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } polkadot-core-primitives = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } polkadot-runtime-parachains = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } +polkadot-runtime-common = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } polkadot-parachain = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } polkadot-primitives = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } xcm = { git = "https://github.com/paritytech//polkadot", rev = "c9ec8c5a15959ce711bb60aa79add58f560d61e9" } diff --git a/asset-registry/src/mock/mod.rs b/asset-registry/src/mock/mod.rs index 97661ddc1..5c09fb5d2 100644 --- a/asset-registry/src/mock/mod.rs +++ b/asset-registry/src/mock/mod.rs @@ -7,7 +7,7 @@ use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_core::bounded::BoundedVec; use sp_io::TestExternalities; -use sp_runtime::{traits::Convert, AccountId32}; +use sp_runtime::{traits::Convert, AccountId32, BuildStorage}; use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain, TestExt}; pub mod para; @@ -238,15 +238,15 @@ pub type ParaXTokens = orml_xtokens::Pallet; pub fn para_ext(para_id: u32, asset_data: Option<(Vec<(u32, Vec)>, u32)>) -> TestExternalities { use para::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); - let parachain_info_config = parachain_info::GenesisConfig { + let parachain_info_config = parachain_info::GenesisConfig:: { + _config: Default::default(), parachain_id: para_id.into(), }; - >::assimilate_storage(¶chain_info_config, &mut t) - .unwrap(); + parachain_info_config.assimilate_storage(&mut t).unwrap(); orml_tokens::GenesisConfig:: { balances: vec![(ALICE, CurrencyId::R, 1_000)], @@ -268,8 +268,8 @@ pub fn para_ext(para_id: u32, asset_data: Option<(Vec<(u32, Vec)>, u32)>) -> pub fn relay_ext() -> sp_io::TestExternalities { use relay::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { diff --git a/asset-registry/src/mock/para.rs b/asset-registry/src/mock/para.rs index 4c2ea1174..a64275d99 100644 --- a/asset-registry/src/mock/para.rs +++ b/asset-registry/src/mock/para.rs @@ -22,7 +22,6 @@ use pallet_xcm::XcmPassthrough; use polkadot_parachain::primitives::Sibling; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, Convert, IdentityLookup}, AccountId32, }; @@ -39,13 +38,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -386,28 +384,23 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - - ParachainInfo: parachain_info::{Pallet, Storage, Config}, - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event}, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event}, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin}, - - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - XTokens: orml_xtokens::{Pallet, Storage, Call, Event}, - AssetRegistry: orml_asset_registry::{Pallet, Storage, Call, Event}, - - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - OrmlXcm: orml_xcm::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + + ParachainInfo: parachain_info, + XcmpQueue: cumulus_pallet_xcmp_queue, + DmpQueue: cumulus_pallet_dmp_queue, + CumulusXcm: cumulus_pallet_xcm, + + Tokens: orml_tokens, + XTokens: orml_xtokens, + AssetRegistry: orml_asset_registry, + + PolkadotXcm: pallet_xcm, + OrmlXcm: orml_xcm, } ); diff --git a/asset-registry/src/mock/relay.rs b/asset-registry/src/mock/relay.rs index 9209d597c..8b8ccab06 100644 --- a/asset-registry/src/mock/relay.rs +++ b/asset-registry/src/mock/relay.rs @@ -12,7 +12,7 @@ use polkadot_runtime_parachains::{ origin, shared, }; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use xcm::v3::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia, @@ -27,13 +27,12 @@ pub type Balance = u128; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -172,7 +171,6 @@ impl pallet_xcm::Config for Runtime { impl origin::Config for Runtime {} -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -216,15 +214,11 @@ impl pallet_message_queue::Config for Runtime { } construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Event}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + MessageQueue: pallet_message_queue, + XcmPallet: pallet_xcm, } ); diff --git a/auction/src/mock.rs b/auction/src/mock.rs index 081db9198..3dda1d2b0 100644 --- a/auction/src/mock.rs +++ b/auction/src/mock.rs @@ -9,7 +9,7 @@ use frame_support::{ }; use orml_traits::OnNewBidResult; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use crate as auction; @@ -20,14 +20,13 @@ pub type AuctionId = u64; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -78,17 +77,12 @@ impl Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - AuctionModule: auction::{Pallet, Storage, Call, Event}, + pub enum Runtime { + System: frame_system, + AuctionModule: auction, } ); @@ -106,8 +100,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); t.into() diff --git a/authority/src/mock.rs b/authority/src/mock.rs index e5c3e8ef8..f42f03144 100644 --- a/authority/src/mock.rs +++ b/authority/src/mock.rs @@ -12,9 +12,8 @@ use frame_support::{ use frame_system::{ensure_root, ensure_signed, EnsureRoot}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BadOrigin, IdentityLookup}, - Perbill, + BuildStorage, Perbill, }; pub use crate as authority; @@ -29,14 +28,13 @@ parameter_types! { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = BlockWeights; @@ -171,20 +169,15 @@ impl Config for Runtime { type WeightInfo = (); } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic - { - System: frame_system::{Pallet, Call, Config, Event}, - Authority: authority::{Pallet, Call, Origin, Event}, - Scheduler: pallet_scheduler::{Pallet, Call, Storage, Event}, - Preimage: pallet_preimage::{Pallet, Call, Storage, Event}, - RootTesting: pallet_root_testing::{Pallet, Call}, + pub enum Runtime { + System: frame_system, + Authority: authority, + Scheduler: pallet_scheduler, + Preimage: pallet_preimage, + RootTesting: pallet_root_testing, } ); @@ -198,8 +191,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); t.into() diff --git a/bencher/test/src/mock.rs b/bencher/test/src/mock.rs index af2ae2532..1ca9c1701 100644 --- a/bencher/test/src/mock.rs +++ b/bencher/test/src/mock.rs @@ -3,6 +3,7 @@ use frame_support::pallet_prelude::ConstU32; use sp_core::H256; use sp_runtime::{ + BuildStorage, traits::{BlakeTwo256, IdentityLookup}, MultiSignature, }; @@ -21,13 +22,9 @@ pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Test: crate::pallet::{Pallet, Call, Storage}, + pub enum Runtime { + System: frame_system, + Test: crate::pallet, } ); @@ -37,14 +34,13 @@ impl frame_system::Config for Runtime { type BlockLength = (); type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type RuntimeCall = RuntimeCall; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = (); type Version = (); @@ -73,8 +69,8 @@ impl Default for ExtBuilder { #[cfg(test)] impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); t.into() diff --git a/benchmarking/src/tests.rs b/benchmarking/src/tests.rs index 5678d4de3..70af2da86 100644 --- a/benchmarking/src/tests.rs +++ b/benchmarking/src/tests.rs @@ -12,6 +12,7 @@ use frame_system::RawOrigin; use sp_runtime::{ testing::{Header, H256}, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use sp_std::prelude::*; pub use test::*; @@ -54,14 +55,13 @@ type AccountId = u128; impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type RuntimeCall = RuntimeCall; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = (); type DbWeight = (); @@ -85,21 +85,17 @@ pub type Block = sp_runtime::generic::Block; pub type UncheckedExtrinsic = sp_runtime::generic::UncheckedExtrinsic; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Pallet: test::{Pallet, Call, Storage}, + pub enum Test { + System: frame_system, + Pallet: test, } ); // This function basically just builds a genesis storage key/value store // according to our desired mockup. fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default() - .build_storage::() + frame_system::GenesisConfig::::default() + .build_storage() .unwrap() .into() } diff --git a/currencies/src/mock.rs b/currencies/src/mock.rs index a3cccc49f..27ee649b9 100644 --- a/currencies/src/mock.rs +++ b/currencies/src/mock.rs @@ -11,9 +11,8 @@ use frame_support::{ use orml_traits::{currency::MutationHooks, parameter_type_with_key}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, IdentityLookup}, - AccountId32, + AccountId32, BuildStorage, }; use crate as currencies; @@ -24,13 +23,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -122,19 +120,14 @@ impl Config for Runtime { pub type NativeCurrency = NativeCurrencyOf; pub type AdaptedBasicCurrency = BasicCurrencyAdapter; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Currencies: currencies::{Pallet, Call}, - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - PalletBalances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + pub enum Runtime { + System: frame_system, + Currencies: currencies, + Tokens: orml_tokens, + PalletBalances: pallet_balances, } ); @@ -166,8 +159,8 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { diff --git a/gradually-update/src/mock.rs b/gradually-update/src/mock.rs index 444336f20..14fb1172b 100644 --- a/gradually-update/src/mock.rs +++ b/gradually-update/src/mock.rs @@ -8,23 +8,21 @@ use frame_support::{ traits::{ConstU32, ConstU64, Everything}, }; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use crate as gradually_update; pub type AccountId = u128; -pub type BlockNumber = u64; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -52,17 +50,12 @@ impl Config for Runtime { type MaxStorageValueBytes = ConstU32<100_000>; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - GraduallyUpdateModule: gradually_update::{Pallet, Storage, Call, Event}, + pub enum Runtime { + System: frame_system, + GraduallyUpdateModule: gradually_update, } ); @@ -76,8 +69,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); t.into() diff --git a/nft/src/mock.rs b/nft/src/mock.rs index 3c25f9677..81a5ce3fa 100644 --- a/nft/src/mock.rs +++ b/nft/src/mock.rs @@ -7,25 +7,23 @@ use frame_support::{ traits::{ConstU32, ConstU64, Everything}, }; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use super::*; use crate as nft; pub type AccountId = u128; -pub type BlockNumber = u64; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -52,17 +50,12 @@ impl Config for Runtime { type MaxTokenMetadata = ConstU32<1>; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - NonFungibleTokenModule: nft::{Pallet, Storage, Config}, + pub enum Runtime { + System: frame_system, + NonFungibleTokenModule: nft, } ); @@ -83,8 +76,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); let mut ext = sp_io::TestExternalities::new(t); diff --git a/oracle/src/mock.rs b/oracle/src/mock.rs index 54240321c..9173bbfac 100644 --- a/oracle/src/mock.rs +++ b/oracle/src/mock.rs @@ -8,8 +8,8 @@ use frame_support::{ }; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use std::cell::RefCell; @@ -25,13 +25,12 @@ type Value = u32; impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -95,24 +94,19 @@ impl Config for Test { type MaxFeedValues = ConstU32<5>; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - ModuleOracle: oracle::{Pallet, Storage, Call, Event}, + pub enum Test { + System: frame_system, + ModuleOracle: oracle, } ); // This function basically just builds a genesis storage key/value store // according to our desired mockup. pub fn new_test_ext() -> sp_io::TestExternalities { - let storage = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut t: sp_io::TestExternalities = storage.into(); diff --git a/payments/src/mock.rs b/payments/src/mock.rs index 7319c20cf..82aac6335 100644 --- a/payments/src/mock.rs +++ b/payments/src/mock.rs @@ -3,18 +3,16 @@ use crate::PaymentDetail; use frame_support::{ dispatch::DispatchClass, parameter_types, - traits::{ConstU32, Contains, Everything, GenesisBuild, Hooks, OnFinalize}, + traits::{ConstU32, Contains, Everything, Hooks, OnFinalize}, }; use frame_system as system; use orml_traits::parameter_type_with_key; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Percent, + BuildStorage, Percent, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; pub type Balance = u128; @@ -32,14 +30,10 @@ pub const MARKETPLACE_FEE_PERCENTAGE: u8 = 10; pub const CANCEL_BLOCK_BUFFER: u64 = 600; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - Tokens: orml_tokens::{Pallet, Call, Config, Storage, Event}, - Payment: payment::{Pallet, Call, Storage, Event}, + pub enum Test { + System: frame_system, + Tokens: orml_tokens, + Payment: payment, } ); @@ -55,13 +49,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -149,7 +142,7 @@ impl payment::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = system::GenesisConfig::::default().build_storage().unwrap(); orml_tokens::GenesisConfig:: { balances: vec![ diff --git a/rewards/src/mock.rs b/rewards/src/mock.rs index e6e92c5d9..fe18f4277 100644 --- a/rewards/src/mock.rs +++ b/rewards/src/mock.rs @@ -9,7 +9,7 @@ use frame_support::{ weights::constants::RocksDbWeight, }; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use sp_std::cell::RefCell; use std::collections::HashMap; @@ -19,7 +19,6 @@ pub type AccountId = u128; pub type Balance = u64; pub type Share = u64; pub type PoolId = u32; -pub type BlockNumber = u64; pub type CurrencyId = u32; pub const ALICE: AccountId = 1; @@ -31,14 +30,13 @@ pub const STABLE_COIN: CurrencyId = 1; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -87,17 +85,12 @@ impl Config for Runtime { type Handler = Handler; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - RewardsModule: rewards::{Pallet, Storage, Call}, + pub enum Runtime { + System: frame_system, + RewardsModule: rewards, } ); @@ -111,8 +104,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); t.into() diff --git a/tokens/src/mock.rs b/tokens/src/mock.rs index 0b27310a2..cd8785d4c 100644 --- a/tokens/src/mock.rs +++ b/tokens/src/mock.rs @@ -5,15 +5,14 @@ use super::*; use frame_support::{ construct_runtime, parameter_types, - traits::{ChangeMembers, ConstU32, ConstU64, ContainsLengthBound, Everything, GenesisBuild, SortedMembers}, + traits::{ChangeMembers, ConstU32, ConstU64, ContainsLengthBound, Everything, SortedMembers}, PalletId, }; use orml_traits::parameter_type_with_key; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{AccountIdConversion, IdentityLookup}, - AccountId32, Permill, + AccountId32, BuildStorage, Permill, }; use sp_std::cell::RefCell; @@ -41,13 +40,12 @@ use crate as tokens; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -419,19 +417,14 @@ impl Config for Runtime { } pub type TreasuryCurrencyAdapter = ::Currency; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Tokens: tokens::{Pallet, Storage, Event, Config}, - Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event}, - ElectionsPhragmen: pallet_elections_phragmen::{Pallet, Call, Storage, Event}, + pub enum Runtime { + System: frame_system, + Tokens: tokens, + Treasury: pallet_treasury, + ElectionsPhragmen: pallet_elections_phragmen, } ); @@ -448,8 +441,8 @@ impl ExtBuilder { } pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); tokens::GenesisConfig:: { @@ -459,7 +452,9 @@ impl ExtBuilder { .unwrap(); if self.treasury_genesis { - GenesisBuild::::assimilate_storage(&pallet_treasury::GenesisConfig::default(), &mut t).unwrap(); + pallet_treasury::GenesisConfig::::default() + .assimilate_storage(&mut t) + .unwrap(); pallet_elections_phragmen::GenesisConfig:: { members: vec![(TREASURY_ACCOUNT, 10)], diff --git a/unknown-tokens/src/mock.rs b/unknown-tokens/src/mock.rs index 3f2172108..a34bec19e 100644 --- a/unknown-tokens/src/mock.rs +++ b/unknown-tokens/src/mock.rs @@ -10,20 +10,19 @@ use frame_support::{ traits::{ConstU64, Everything}, }; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32, BuildStorage}; pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -45,17 +44,12 @@ impl Config for Runtime { type RuntimeEvent = RuntimeEvent; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - UnknownTokens: unknown_tokens::{Pallet, Storage, Event}, + pub enum Runtime { + System: frame_system, + UnknownTokens: unknown_tokens, } ); @@ -63,8 +57,8 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default() - .build_storage::() + let t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); let mut ext = sp_io::TestExternalities::new(t); diff --git a/utilities/src/lib.rs b/utilities/src/lib.rs index 4ef4db7d4..ad2b61c82 100644 --- a/utilities/src/lib.rs +++ b/utilities/src/lib.rs @@ -43,7 +43,7 @@ mod tests { use frame_support::{assert_noop, assert_ok, construct_runtime, pallet_prelude::*, traits::Everything}; use sp_core::{ConstU64, H256}; use sp_io::TestExternalities; - use sp_runtime::{testing::Header, traits::IdentityLookup}; + use sp_runtime::traits::IdentityLookup; use sp_runtime::{DispatchError, DispatchResult}; use sp_std::result::Result; @@ -69,14 +69,13 @@ mod tests { impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = u128; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -96,15 +95,10 @@ mod tests { impl module::Config for Runtime {} - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { + pub enum Runtime { System: frame_system, TestModule: module, } diff --git a/vesting/src/mock.rs b/vesting/src/mock.rs index bab68748b..48ffd32f6 100644 --- a/vesting/src/mock.rs +++ b/vesting/src/mock.rs @@ -9,7 +9,7 @@ use frame_support::{ }; use frame_system::RawOrigin; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup}; +use sp_runtime::{traits::IdentityLookup, BuildStorage}; use crate as vesting; @@ -17,13 +17,12 @@ pub type AccountId = u128; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -86,7 +85,7 @@ parameter_types! { impl BlockNumberProvider for MockBlockNumberProvider { type BlockNumber = u64; - fn current_block_number() -> BlockNumberFor { + fn current_block_number() -> BlockNumberFor { Self::get() } } @@ -101,18 +100,13 @@ impl Config for Runtime { type BlockNumberProvider = MockBlockNumberProvider; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Vesting: vesting::{Pallet, Storage, Call, Event, Config}, - PalletBalances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + pub enum Runtime { + System: frame_system, + Vesting: vesting, + PalletBalances: pallet_balances, } ); @@ -128,8 +122,8 @@ pub struct ExtBuilder; impl ExtBuilder { pub fn build() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { diff --git a/weight-meter/src/mock.rs b/weight-meter/src/mock.rs index b553e03fe..f98c4bfc0 100644 --- a/weight-meter/src/mock.rs +++ b/weight-meter/src/mock.rs @@ -136,24 +136,20 @@ pub mod test_module { use frame_support::sp_runtime::traits::IdentityLookup; use frame_support::traits::{ConstU128, ConstU32, ConstU64, Everything}; -use sp_runtime::testing::{Header, H256}; +use sp_runtime::{testing::H256, BuildStorage}; -pub type BlockNumber = u64; - -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Balance = u128; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = BlockNumber; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -190,14 +186,10 @@ impl pallet_balances::Config for Runtime { impl test_module::Config for Runtime {} frame_support::construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - TestModule: test_module::{Pallet, Call, Storage}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, + pub enum Runtime { + System: frame_system, + TestModule: test_module, + Balances: pallet_balances, } ); @@ -211,8 +203,8 @@ impl Default for ExtBuilder { impl ExtBuilder { pub fn build(self) -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { diff --git a/xtokens/src/mock/mod.rs b/xtokens/src/mock/mod.rs index 56aa63012..7cd69b032 100644 --- a/xtokens/src/mock/mod.rs +++ b/xtokens/src/mock/mod.rs @@ -6,7 +6,7 @@ use crate as orml_xtokens; use scale_info::TypeInfo; use serde::{Deserialize, Serialize}; use sp_io::TestExternalities; -use sp_runtime::{AccountId32, BoundedVec}; +use sp_runtime::{AccountId32, BoundedVec, BuildStorage}; use xcm_executor::traits::WeightTrader; use xcm_executor::Assets; @@ -241,15 +241,15 @@ pub type ParaTeleportTokens = orml_tokens::Pallet; pub fn para_ext(para_id: u32) -> TestExternalities { use para::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); - let parachain_info_config = parachain_info::GenesisConfig { + let parachain_info_config = parachain_info::GenesisConfig:: { + _config: Default::default(), parachain_id: para_id.into(), }; - >::assimilate_storage(¶chain_info_config, &mut t) - .unwrap(); + parachain_info_config.assimilate_storage(&mut t).unwrap(); orml_tokens::GenesisConfig:: { balances: vec![(ALICE, CurrencyId::R, 1_000)], @@ -265,15 +265,15 @@ pub fn para_ext(para_id: u32) -> TestExternalities { pub fn para_teleport_ext(para_id: u32) -> TestExternalities { use para_teleport::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); - let parachain_info_config = parachain_info::GenesisConfig { + let parachain_info_config = parachain_info::GenesisConfig:: { + _config: Default::default(), parachain_id: para_id.into(), }; - >::assimilate_storage(¶chain_info_config, &mut t) - .unwrap(); + parachain_info_config.assimilate_storage(&mut t).unwrap(); orml_tokens::GenesisConfig:: { balances: vec![(ALICE, CurrencyId::R, 1_000)], @@ -289,8 +289,8 @@ pub fn para_teleport_ext(para_id: u32) -> TestExternalities { pub fn relay_ext() -> sp_io::TestExternalities { use relay::{Runtime, System}; - let mut t = frame_system::GenesisConfig::default() - .build_storage::() + let mut t = frame_system::GenesisConfig::::default() + .build_storage() .unwrap(); pallet_balances::GenesisConfig:: { diff --git a/xtokens/src/mock/para.rs b/xtokens/src/mock/para.rs index e07bb3422..b3890877f 100644 --- a/xtokens/src/mock/para.rs +++ b/xtokens/src/mock/para.rs @@ -9,7 +9,6 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{Convert, IdentityLookup}, AccountId32, }; @@ -34,13 +33,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -300,27 +298,22 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - - ParachainInfo: parachain_info::{Pallet, Storage, Config}, - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event}, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event}, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin}, - - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - XTokens: orml_xtokens::{Pallet, Storage, Call, Event}, - - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - OrmlXcm: orml_xcm::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + + ParachainInfo: parachain_info, + XcmpQueue: cumulus_pallet_xcmp_queue, + DmpQueue: cumulus_pallet_dmp_queue, + CumulusXcm: cumulus_pallet_xcm, + + Tokens: orml_tokens, + XTokens: orml_xtokens, + + PolkadotXcm: pallet_xcm, + OrmlXcm: orml_xcm, } ); diff --git a/xtokens/src/mock/para_relative_view.rs b/xtokens/src/mock/para_relative_view.rs index 1e2c16e2d..38bb3b95c 100644 --- a/xtokens/src/mock/para_relative_view.rs +++ b/xtokens/src/mock/para_relative_view.rs @@ -9,7 +9,6 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{Convert, IdentityLookup}, AccountId32, BoundedVec, }; @@ -37,13 +36,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -423,27 +421,22 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - - ParachainInfo: parachain_info::{Pallet, Storage, Config}, - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event}, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event}, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin}, - - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - XTokens: orml_xtokens::{Pallet, Storage, Call, Event}, - - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - OrmlXcm: orml_xcm::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + + ParachainInfo: parachain_info, + XcmpQueue: cumulus_pallet_xcmp_queue, + DmpQueue: cumulus_pallet_dmp_queue, + CumulusXcm: cumulus_pallet_xcm, + + Tokens: orml_tokens, + XTokens: orml_xtokens, + + PolkadotXcm: pallet_xcm, + OrmlXcm: orml_xcm, } ); diff --git a/xtokens/src/mock/para_teleport.rs b/xtokens/src/mock/para_teleport.rs index cbaeee927..fe6c37be6 100644 --- a/xtokens/src/mock/para_teleport.rs +++ b/xtokens/src/mock/para_teleport.rs @@ -9,7 +9,6 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{Convert, IdentityLookup}, AccountId32, }; @@ -35,13 +34,12 @@ pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -291,27 +289,22 @@ impl orml_xcm::Config for Runtime { type SovereignOrigin = EnsureRoot; } -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - - ParachainInfo: parachain_info::{Pallet, Storage, Config}, - XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event}, - DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event}, - CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin}, - - Tokens: orml_tokens::{Pallet, Storage, Event, Config}, - XTokens: orml_xtokens::{Pallet, Storage, Call, Event}, - - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin}, - OrmlXcm: orml_xcm::{Pallet, Call, Event}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + + ParachainInfo: parachain_info, + XcmpQueue: cumulus_pallet_xcmp_queue, + DmpQueue: cumulus_pallet_dmp_queue, + CumulusXcm: cumulus_pallet_xcm, + + Tokens: orml_tokens, + XTokens: orml_xtokens, + + PolkadotXcm: pallet_xcm, + OrmlXcm: orml_xcm, } ); diff --git a/xtokens/src/mock/relay.rs b/xtokens/src/mock/relay.rs index b3683e62c..06309ffed 100644 --- a/xtokens/src/mock/relay.rs +++ b/xtokens/src/mock/relay.rs @@ -5,7 +5,7 @@ use frame_support::{ }; use frame_system::EnsureRoot; use sp_core::H256; -use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32}; +use sp_runtime::{traits::IdentityLookup, AccountId32}; use crate::Weight; use cumulus_primitives_core::ParaId; @@ -28,13 +28,12 @@ pub type Balance = u128; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type BlockWeights = (); @@ -178,7 +177,6 @@ impl pallet_xcm::Config for Runtime { impl origin::Config for Runtime {} -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; parameter_types! { @@ -222,15 +220,11 @@ impl pallet_message_queue::Config for Runtime { } construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, - { - System: frame_system::{Pallet, Call, Storage, Config, Event}, - Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, - ParasOrigin: origin::{Pallet, Origin}, - MessageQueue: pallet_message_queue::{Pallet, Event}, - XcmPallet: pallet_xcm::{Pallet, Call, Storage, Event, Origin}, + pub enum Runtime { + System: frame_system, + Balances: pallet_balances, + ParasOrigin: origin, + MessageQueue: pallet_message_queue, + XcmPallet: pallet_xcm, } ); From 327f3e0473e6dba888e56f2abe4c68c450a120b6 Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Fri, 4 Aug 2023 15:40:44 +1200 Subject: [PATCH 3/3] fmt --- bencher/test/src/mock.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bencher/test/src/mock.rs b/bencher/test/src/mock.rs index 1ca9c1701..49a125804 100644 --- a/bencher/test/src/mock.rs +++ b/bencher/test/src/mock.rs @@ -3,9 +3,8 @@ use frame_support::pallet_prelude::ConstU32; use sp_core::H256; use sp_runtime::{ - BuildStorage, traits::{BlakeTwo256, IdentityLookup}, - MultiSignature, + BuildStorage, MultiSignature, }; use sp_std::prelude::*;