From fc48530259272820b3a03e5fac3a1a3f44c7776c Mon Sep 17 00:00:00 2001 From: Jegor Sidorenko Date: Mon, 13 Feb 2023 13:07:48 +0200 Subject: [PATCH 01/15] Assets balances --- .../assets/statemine/src/assets_api.rs | 34 +++++++++++++++++++ .../runtimes/assets/statemine/src/lib.rs | 13 +++++++ .../assets/statemint/src/assets_api.rs | 34 +++++++++++++++++++ .../runtimes/assets/statemint/src/lib.rs | 13 +++++++ .../assets/westmint/src/assets_api.rs | 34 +++++++++++++++++++ .../runtimes/assets/westmint/src/lib.rs | 13 +++++++ 6 files changed, 141 insertions(+) create mode 100644 parachains/runtimes/assets/statemine/src/assets_api.rs create mode 100644 parachains/runtimes/assets/statemint/src/assets_api.rs create mode 100644 parachains/runtimes/assets/westmint/src/assets_api.rs diff --git a/parachains/runtimes/assets/statemine/src/assets_api.rs b/parachains/runtimes/assets/statemine/src/assets_api.rs new file mode 100644 index 00000000000..5461a05427b --- /dev/null +++ b/parachains/runtimes/assets/statemine/src/assets_api.rs @@ -0,0 +1,34 @@ +// This file is part of Substrate. + +// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Runtime API definition for assets. + +use codec::Codec; +use sp_std::vec::Vec; + +sp_api::decl_runtime_apis! { + pub trait AssetsApi + where + AccountId: Codec, + AssetBalance: Codec, + AssetId: Codec, + { + /// Returns the list of asset id and non-zero balances the AccountId has. + fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; + } +} diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 90cd768f989..8a2d9c8843d 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -24,6 +24,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -831,6 +832,18 @@ impl_runtime_apis! { } } + impl assets_api::AssetsApi< + Block, + AccountId, + Balance, + AssetIdForTrustBackedAssets, + > for Runtime + { + fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { + Assets::account_balances(account) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) diff --git a/parachains/runtimes/assets/statemint/src/assets_api.rs b/parachains/runtimes/assets/statemint/src/assets_api.rs new file mode 100644 index 00000000000..5461a05427b --- /dev/null +++ b/parachains/runtimes/assets/statemint/src/assets_api.rs @@ -0,0 +1,34 @@ +// This file is part of Substrate. + +// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Runtime API definition for assets. + +use codec::Codec; +use sp_std::vec::Vec; + +sp_api::decl_runtime_apis! { + pub trait AssetsApi + where + AccountId: Codec, + AssetBalance: Codec, + AssetId: Codec, + { + /// Returns the list of asset id and non-zero balances the AccountId has. + fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; + } +} diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index b03c68ada10..683e98d7b71 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -53,6 +53,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -828,6 +829,18 @@ impl_runtime_apis! { } } + impl assets_api::AssetsApi< + Block, + AccountId, + Balance, + AssetIdForTrustBackedAssets, + > for Runtime + { + fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { + Assets::account_balances(account) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) diff --git a/parachains/runtimes/assets/westmint/src/assets_api.rs b/parachains/runtimes/assets/westmint/src/assets_api.rs new file mode 100644 index 00000000000..5461a05427b --- /dev/null +++ b/parachains/runtimes/assets/westmint/src/assets_api.rs @@ -0,0 +1,34 @@ +// This file is part of Substrate. + +// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Runtime API definition for assets. + +use codec::Codec; +use sp_std::vec::Vec; + +sp_api::decl_runtime_apis! { + pub trait AssetsApi + where + AccountId: Codec, + AssetBalance: Codec, + AssetId: Codec, + { + /// Returns the list of asset id and non-zero balances the AccountId has. + fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; + } +} diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 6d2dad5f6c3..72c656f68e6 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -24,6 +24,7 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); +pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -840,6 +841,18 @@ impl_runtime_apis! { } } + impl assets_api::AssetsApi< + Block, + AccountId, + Balance, + AssetIdForTrustBackedAssets, + > for Runtime + { + fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { + Assets::account_balances(account) + } + } + impl cumulus_primitives_core::CollectCollationInfo for Runtime { fn collect_collation_info(header: &::Header) -> cumulus_primitives_core::CollationInfo { ParachainSystem::collect_collation_info(header) From a5648712d0d8fce991d32a61edf627c29552d7a1 Mon Sep 17 00:00:00 2001 From: Jegor Sidorenko Date: Mon, 13 Feb 2023 14:27:51 +0200 Subject: [PATCH 02/15] Update docs --- parachains/runtimes/assets/statemine/src/assets_api.rs | 2 +- parachains/runtimes/assets/statemint/src/assets_api.rs | 2 +- parachains/runtimes/assets/westmint/src/assets_api.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/assets_api.rs b/parachains/runtimes/assets/statemine/src/assets_api.rs index 5461a05427b..cf1a663d703 100644 --- a/parachains/runtimes/assets/statemine/src/assets_api.rs +++ b/parachains/runtimes/assets/statemine/src/assets_api.rs @@ -28,7 +28,7 @@ sp_api::decl_runtime_apis! { AssetBalance: Codec, AssetId: Codec, { - /// Returns the list of asset id and non-zero balances the AccountId has. + /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; } } diff --git a/parachains/runtimes/assets/statemint/src/assets_api.rs b/parachains/runtimes/assets/statemint/src/assets_api.rs index 5461a05427b..cf1a663d703 100644 --- a/parachains/runtimes/assets/statemint/src/assets_api.rs +++ b/parachains/runtimes/assets/statemint/src/assets_api.rs @@ -28,7 +28,7 @@ sp_api::decl_runtime_apis! { AssetBalance: Codec, AssetId: Codec, { - /// Returns the list of asset id and non-zero balances the AccountId has. + /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; } } diff --git a/parachains/runtimes/assets/westmint/src/assets_api.rs b/parachains/runtimes/assets/westmint/src/assets_api.rs index 5461a05427b..cf1a663d703 100644 --- a/parachains/runtimes/assets/westmint/src/assets_api.rs +++ b/parachains/runtimes/assets/westmint/src/assets_api.rs @@ -28,7 +28,7 @@ sp_api::decl_runtime_apis! { AssetBalance: Codec, AssetId: Codec, { - /// Returns the list of asset id and non-zero balances the AccountId has. + /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; } } From d744cace40a2606278c5a2dfccb7de7532ed2f30 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 15 Feb 2023 10:51:58 +0100 Subject: [PATCH 03/15] AssetsApi with MultiLocation as preparation for multi pallet_assets instances (#2187) * AssetsApi with MultiLocation for Westmint + assets-common * AssetsApi with MultiLocation for Statemine/t * typo --- Cargo.lock | 18 +++ Cargo.toml | 1 + parachains/runtimes/assets/common/Cargo.toml | 40 ++++++ .../{statemine => common}/src/assets_api.rs | 12 +- parachains/runtimes/assets/common/src/lib.rs | 78 +++++++++++ .../runtimes/assets/statemine/Cargo.toml | 5 +- .../runtimes/assets/statemine/src/lib.rs | 13 +- .../assets/statemine/src/xcm_config.rs | 27 ++-- .../runtimes/assets/statemine/tests/tests.rs | 121 ++++++++++-------- .../runtimes/assets/statemint/Cargo.toml | 4 +- .../assets/statemint/src/assets_api.rs | 34 ----- .../runtimes/assets/statemint/src/lib.rs | 15 ++- .../assets/statemint/src/xcm_config.rs | 27 ++-- .../runtimes/assets/statemint/tests/tests.rs | 121 ++++++++++-------- .../runtimes/assets/westmint/Cargo.toml | 4 +- .../assets/westmint/src/assets_api.rs | 34 ----- .../runtimes/assets/westmint/src/lib.rs | 15 ++- .../assets/westmint/src/xcm_config.rs | 27 ++-- .../runtimes/assets/westmint/tests/tests.rs | 121 ++++++++++-------- 19 files changed, 412 insertions(+), 305 deletions(-) create mode 100644 parachains/runtimes/assets/common/Cargo.toml rename parachains/runtimes/assets/{statemine => common}/src/assets_api.rs (72%) create mode 100644 parachains/runtimes/assets/common/src/lib.rs delete mode 100644 parachains/runtimes/assets/statemint/src/assets_api.rs delete mode 100644 parachains/runtimes/assets/westmint/src/assets_api.rs diff --git a/Cargo.lock b/Cargo.lock index 6e5f639d006..3785d10c65a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -342,6 +342,21 @@ dependencies = [ "substrate-wasm-builder", ] +[[package]] +name = "assets-common" +version = "0.1.0" +dependencies = [ + "frame-support", + "parachains-common", + "parity-scale-codec", + "sp-api", + "sp-std", + "substrate-wasm-builder", + "xcm", + "xcm-builder", + "xcm-executor", +] + [[package]] name = "async-io" version = "1.6.0" @@ -12238,6 +12253,7 @@ name = "statemine-runtime" version = "2.0.0" dependencies = [ "asset-test-utils", + "assets-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -12304,6 +12320,7 @@ name = "statemint-runtime" version = "1.0.0" dependencies = [ "asset-test-utils", + "assets-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -14280,6 +14297,7 @@ name = "westmint-runtime" version = "1.0.0" dependencies = [ "asset-test-utils", + "assets-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", diff --git a/Cargo.toml b/Cargo.toml index a4b817ffe87..acb6ae62f72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ members = [ "parachains/runtimes/testing/rococo-parachain", "parachains/runtimes/starters/shell", "parachains/runtimes/starters/seedling", + "parachains/runtimes/assets/common", "parachains/runtimes/assets/statemint", "parachains/runtimes/assets/statemine", "parachains/runtimes/assets/westmint", diff --git a/parachains/runtimes/assets/common/Cargo.toml b/parachains/runtimes/assets/common/Cargo.toml new file mode 100644 index 00000000000..6f239c8715b --- /dev/null +++ b/parachains/runtimes/assets/common/Cargo.toml @@ -0,0 +1,40 @@ +[package] +name = "assets-common" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" +description = "Assets common utilities" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } + +# Substrate +frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } + +# Polkadot +xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } + +# Cumulus +parachains-common = { path = "../../../common", default-features = false } + +#[dev-dependencies] + +[build-dependencies] +substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } + +[features] +default = [ "std" ] +std = [ + "codec/std", + "frame-support/std", + "parachains-common/std", + "sp-api/std", + "sp-std/std", + "xcm/std", + "xcm-builder/std", + "xcm-executor/std", +] diff --git a/parachains/runtimes/assets/statemine/src/assets_api.rs b/parachains/runtimes/assets/common/src/assets_api.rs similarity index 72% rename from parachains/runtimes/assets/statemine/src/assets_api.rs rename to parachains/runtimes/assets/common/src/assets_api.rs index cf1a663d703..05e69e2546d 100644 --- a/parachains/runtimes/assets/statemine/src/assets_api.rs +++ b/parachains/runtimes/assets/common/src/assets_api.rs @@ -18,9 +18,17 @@ //! Runtime API definition for assets. -use codec::Codec; +use codec::{Codec, Decode, Encode}; +use frame_support::RuntimeDebug; use sp_std::vec::Vec; +/// The possible errors that can happen querying the storage of assets. +#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] +pub enum AssetsAccessError { + /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. + AssetIdConversionFailed, +} + sp_api::decl_runtime_apis! { pub trait AssetsApi where @@ -29,6 +37,6 @@ sp_api::decl_runtime_apis! { AssetId: Codec, { /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. - fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; + fn account_balances(account: AccountId) -> Result, AssetsAccessError>; } } diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs new file mode 100644 index 00000000000..4ed04c73118 --- /dev/null +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -0,0 +1,78 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub mod assets_api; + +use parachains_common::AssetIdForTrustBackedAssets; +use sp_std::prelude::Vec; +use xcm::latest::MultiLocation; +use xcm_builder::AsPrefixedGeneralIndex; +use xcm_executor::traits::{Convert, JustTry}; + +/// [`MultiLocation`] converter for [`TrustBackedAssets`]'s [`AssetIdForTrustBackedAssets`] +pub type AssetIdForTrustBackedAssetsConvert = + AsPrefixedGeneralIndex; + +/// Helper function to convert collections with (`AssetId`, 'Balance') to (`MultiLocation`, 'Balance') +pub fn convert_asset_id( + assets_balances: Vec<(AssetId, Balance)>, +) -> Result, assets_api::AssetsAccessError> +where + ConvertAssetId: Convert, +{ + assets_balances + .into_iter() + .map(|(asset_id, balance)| { + ConvertAssetId::reverse_ref(asset_id) + .map(|converted_asset_id| (converted_asset_id, balance)) + .map_err(|_| assets_api::AssetsAccessError::AssetIdConversionFailed) + }) + .collect() +} + +#[cfg(test)] +mod tests { + + use super::*; + use xcm::latest::prelude::*; + + frame_support::parameter_types! { + pub TrustBackedAssetsPalletLocation: MultiLocation = MultiLocation::new(5, X1(PalletInstance(13))); + } + + #[test] + fn asset_id_for_trust_backed_assets_convert_works() { + let local_asset_id = 123456789 as AssetIdForTrustBackedAssets; + let expected_reverse_ref = + MultiLocation::new(5, X2(PalletInstance(13), GeneralIndex(local_asset_id.into()))); + + assert_eq!( + AssetIdForTrustBackedAssetsConvert::::reverse_ref( + local_asset_id + ) + .unwrap(), + expected_reverse_ref + ); + assert_eq!( + AssetIdForTrustBackedAssetsConvert::::convert_ref( + expected_reverse_ref + ) + .unwrap(), + local_asset_id + ); + } +} diff --git a/parachains/runtimes/assets/statemine/Cargo.toml b/parachains/runtimes/assets/statemine/Cargo.toml index 7ec11cf5786..0f0921976a8 100644 --- a/parachains/runtimes/assets/statemine/Cargo.toml +++ b/parachains/runtimes/assets/statemine/Cargo.toml @@ -49,6 +49,7 @@ pallet-state-trie-migration = { git = "https://github.com/paritytech/substrate", # Polkadot kusama-runtime-constants = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -69,8 +70,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } - +assets-common = { path = "../common", default-features = false } [dev-dependencies] asset-test-utils = { path = "../test-utils"} @@ -187,4 +187,5 @@ std = [ "pallet-collator-selection/std", "parachain-info/std", "parachains-common/std", + "assets-common/std", ] diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 8a2d9c8843d..6e8702ff11f 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -24,7 +24,6 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -65,7 +64,7 @@ use parachains_common::{ Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{KsmLocation, XcmConfig}; +use xcm_config::{AssetIdForTrustBackedAssetsConvert, KsmLocation, XcmConfig}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -832,15 +831,17 @@ impl_runtime_apis! { } } - impl assets_api::AssetsApi< + impl assets_common::assets_api::AssetsApi< Block, AccountId, Balance, - AssetIdForTrustBackedAssets, + xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { - Assets::account_balances(account) + fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + Ok([ + assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + ].concat()) } } diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 43b1c67f0bd..6038560a5ce 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -34,12 +34,11 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, - NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, + EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::{ traits::{JustTry, WithOriginFilter}, @@ -84,6 +83,10 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; +/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] +pub type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: @@ -92,11 +95,7 @@ pub type FungiblesTransactor = FungiblesAdapter< ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, // Convert an XCM MultiLocation into a local account id: @@ -305,11 +304,7 @@ impl xcm_executor::Config for XcmConfig { ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, Assets, diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index 9614fd80062..610f7e75723 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -2,17 +2,18 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ assert_noop, assert_ok, - traits::PalletInfo, weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AuraId}; -use statemine_runtime::xcm_config::AssetFeeAsExistentialDepositMultiplierFeeCharger; +use statemine_runtime::xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, +}; pub use statemine_runtime::{ constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, Runtime, SessionKeys, System, }; use xcm::latest::prelude::*; -use xcm_executor::traits::WeightTrader; +use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; @@ -47,16 +48,8 @@ fn test_asset_xcm_trader() { )); // get asset id as multilocation - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(local_asset_id.into()), - ), - ); + let asset_multilocation = + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); @@ -94,12 +87,15 @@ fn test_asset_xcm_trader() { // Make sure author(Alice) has received the amount assert_eq!( - Assets::balance(1, AccountId::from(ALICE)), + Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance + asset_amount_needed ); // We also need to ensure the total supply increased - assert_eq!(Assets::total_supply(1), minimum_asset_balance + asset_amount_needed); + assert_eq!( + Assets::total_supply(local_asset_id), + minimum_asset_balance + asset_amount_needed + ); }); } @@ -140,16 +136,7 @@ fn test_asset_xcm_trader_with_refund() { // We are going to buy 4e9 weight let bought = Weight::from_ref_time(4_000_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -218,16 +205,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { // We are going to buy small amount let bought = Weight::from_ref_time(500_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -278,16 +256,7 @@ fn test_that_buying_ed_refund_does_not_refund() { // We are gonna buy ED let bought = Weight::from_ref_time(ExistentialDeposit::get().try_into().unwrap()); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -362,16 +331,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -388,3 +348,54 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { assert_eq!(Assets::total_supply(1), minimum_asset_balance); }); } + +#[test] +fn test_assets_balances_api_works() { + use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + + ExtBuilder::::default() + .with_collators(vec![AccountId::from(ALICE)]) + .with_session_keys(vec![( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }, + )]) + .build() + .execute_with(|| { + let local_asset_id = 1; + + // check before + assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); + assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // We need root origin to create a sufficient asset + let minimum_asset_balance = 3333333_u128; + assert_ok!(Assets::force_create( + RuntimeHelper::::root_origin(), + local_asset_id.into(), + AccountId::from(ALICE).into(), + true, + minimum_asset_balance + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(Assets::mint( + RuntimeHelper::::origin_of(AccountId::from(ALICE)), + local_asset_id.into(), + AccountId::from(ALICE).into(), + minimum_asset_balance + )); + + // check after + assert_eq!( + Assets::balance(local_asset_id, AccountId::from(ALICE)), + minimum_asset_balance + ); + let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 1); + assert!(result.iter().any(|asset| asset.eq(&( + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + minimum_asset_balance + )))); + }); +} diff --git a/parachains/runtimes/assets/statemint/Cargo.toml b/parachains/runtimes/assets/statemint/Cargo.toml index 08d3f689152..f6d54cbd85f 100644 --- a/parachains/runtimes/assets/statemint/Cargo.toml +++ b/parachains/runtimes/assets/statemint/Cargo.toml @@ -47,6 +47,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", default-features # Polkadot pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -68,7 +69,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } +assets-common = { path = "../common", default-features = false } [dev-dependencies] hex-literal = "0.3.4" @@ -176,4 +177,5 @@ std = [ "pallet-collator-selection/std", "parachain-info/std", "parachains-common/std", + "assets-common/std", ] diff --git a/parachains/runtimes/assets/statemint/src/assets_api.rs b/parachains/runtimes/assets/statemint/src/assets_api.rs deleted file mode 100644 index cf1a663d703..00000000000 --- a/parachains/runtimes/assets/statemint/src/assets_api.rs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Runtime API definition for assets. - -use codec::Codec; -use sp_std::vec::Vec; - -sp_api::decl_runtime_apis! { - pub trait AssetsApi - where - AccountId: Codec, - AssetBalance: Codec, - AssetId: Codec, - { - /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. - fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; - } -} diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 683e98d7b71..23bdb8ac669 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -53,7 +53,6 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -94,7 +93,9 @@ use parachains_common::{ Signature, StatemintAuraId as AuraId, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{ + AssetIdForTrustBackedAssetsConvert, DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -829,15 +830,17 @@ impl_runtime_apis! { } } - impl assets_api::AssetsApi< + impl assets_common::assets_api::AssetsApi< Block, AccountId, Balance, - AssetIdForTrustBackedAssets, + xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { - Assets::account_balances(account) + fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + Ok([ + assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + ].concat()) } } diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index 21daa980cc5..23358bc34c2 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -34,12 +34,11 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, - NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, + EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::{ traits::{JustTry, WithOriginFilter}, @@ -84,6 +83,10 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; +/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] +pub type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: @@ -92,11 +95,7 @@ pub type FungiblesTransactor = FungiblesAdapter< ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, // Convert an XCM MultiLocation into a local account id: @@ -305,11 +304,7 @@ impl xcm_executor::Config for XcmConfig { ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, Assets, diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index b52383f3d3e..33028db5891 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -2,17 +2,18 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ assert_noop, assert_ok, - traits::PalletInfo, weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, StatemintAuraId as AuraId}; -use statemint_runtime::xcm_config::AssetFeeAsExistentialDepositMultiplierFeeCharger; +use statemint_runtime::xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, +}; pub use statemint_runtime::{ constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, Runtime, SessionKeys, System, }; use xcm::latest::prelude::*; -use xcm_executor::traits::WeightTrader; +use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; @@ -47,16 +48,8 @@ fn test_asset_xcm_trader() { )); // get asset id as multilocation - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(local_asset_id.into()), - ), - ); + let asset_multilocation = + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); @@ -97,12 +90,15 @@ fn test_asset_xcm_trader() { // Make sure author(Alice) has received the amount assert_eq!( - Assets::balance(1, AccountId::from(ALICE)), + Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance + asset_amount_needed ); // We also need to ensure the total supply increased - assert_eq!(Assets::total_supply(1), minimum_asset_balance + asset_amount_needed); + assert_eq!( + Assets::total_supply(local_asset_id), + minimum_asset_balance + asset_amount_needed + ); }); } @@ -146,16 +142,7 @@ fn test_asset_xcm_trader_with_refund() { // bit more of weight let bought = Weight::from_ref_time(400_000_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -227,16 +214,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { // bit more of weight let bought = Weight::from_ref_time(50_000_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -287,16 +265,7 @@ fn test_that_buying_ed_refund_does_not_refund() { // We are gonna buy ED let bought = Weight::from_ref_time(ExistentialDeposit::get().try_into().unwrap()); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -374,16 +343,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -400,3 +360,54 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { assert_eq!(Assets::total_supply(1), minimum_asset_balance); }); } + +#[test] +fn test_assets_balances_api_works() { + use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + + ExtBuilder::::default() + .with_collators(vec![AccountId::from(ALICE)]) + .with_session_keys(vec![( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::ed25519::Public::from_raw(ALICE)) }, + )]) + .build() + .execute_with(|| { + let local_asset_id = 1; + + // check before + assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); + assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // We need root origin to create a sufficient asset + let minimum_asset_balance = 3333333_u128; + assert_ok!(Assets::force_create( + RuntimeHelper::::root_origin(), + local_asset_id.into(), + AccountId::from(ALICE).into(), + true, + minimum_asset_balance + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(Assets::mint( + RuntimeHelper::::origin_of(AccountId::from(ALICE)), + local_asset_id.into(), + AccountId::from(ALICE).into(), + minimum_asset_balance + )); + + // check after + assert_eq!( + Assets::balance(local_asset_id, AccountId::from(ALICE)), + minimum_asset_balance + ); + let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 1); + assert!(result.iter().any(|asset| asset.eq(&( + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + minimum_asset_balance + )))); + }); +} diff --git a/parachains/runtimes/assets/westmint/Cargo.toml b/parachains/runtimes/assets/westmint/Cargo.toml index 9bfcba6b237..e5a6e30939b 100644 --- a/parachains/runtimes/assets/westmint/Cargo.toml +++ b/parachains/runtimes/assets/westmint/Cargo.toml @@ -48,6 +48,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", default-features # Polkadot pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } +pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" } @@ -69,7 +70,7 @@ cumulus-primitives-utility = { path = "../../../../primitives/utility", default- pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false } parachain-info = { path = "../../../pallets/parachain-info", default-features = false } parachains-common = { path = "../../../common", default-features = false } -pallet-xcm-benchmarks = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, optional = true } +assets-common = { path = "../common", default-features = false } [dev-dependencies] hex-literal = "0.3.4" @@ -180,4 +181,5 @@ std = [ "pallet-collator-selection/std", "parachain-info/std", "parachains-common/std", + "assets-common/std", ] diff --git a/parachains/runtimes/assets/westmint/src/assets_api.rs b/parachains/runtimes/assets/westmint/src/assets_api.rs deleted file mode 100644 index cf1a663d703..00000000000 --- a/parachains/runtimes/assets/westmint/src/assets_api.rs +++ /dev/null @@ -1,34 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2018-2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Runtime API definition for assets. - -use codec::Codec; -use sp_std::vec::Vec; - -sp_api::decl_runtime_apis! { - pub trait AssetsApi - where - AccountId: Codec, - AssetBalance: Codec, - AssetId: Codec, - { - /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. - fn account_balances(account: AccountId) -> Vec<(AssetId, AssetBalance)>; - } -} diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 72c656f68e6..2084a9771f0 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -24,7 +24,6 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -pub mod assets_api; pub mod constants; mod weights; pub mod xcm_config; @@ -66,7 +65,9 @@ use parachains_common::{ Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin}; +use xcm_config::{ + AssetIdForTrustBackedAssetsConvert, XcmConfig, XcmOriginToTransactDispatchOrigin, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -841,15 +842,17 @@ impl_runtime_apis! { } } - impl assets_api::AssetsApi< + impl assets_common::assets_api::AssetsApi< Block, AccountId, Balance, - AssetIdForTrustBackedAssets, + xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Vec<(AssetIdForTrustBackedAssets, Balance)> { - Assets::account_balances(account) + fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + Ok([ + assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + ].concat()) } } diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index fd2e349a2c3..3e94e3ab161 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -34,12 +34,11 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, AsPrefixedGeneralIndex, - ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, - NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, - SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, - SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, - WithComputedOrigin, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, + EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, + ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, + UsingComponents, WeightInfoBounds, WithComputedOrigin, }; use xcm_executor::{ traits::{JustTry, WithOriginFilter}, @@ -84,6 +83,10 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; +/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] +pub type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: @@ -92,11 +95,7 @@ pub type FungiblesTransactor = FungiblesAdapter< ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, // Convert an XCM MultiLocation into a local account id: @@ -300,11 +299,7 @@ impl xcm_executor::Config for XcmConfig { ConvertedConcreteId< AssetIdForTrustBackedAssets, Balance, - AsPrefixedGeneralIndex< - TrustBackedAssetsPalletLocation, - AssetIdForTrustBackedAssets, - JustTry, - >, + AssetIdForTrustBackedAssetsConvert, JustTry, >, Assets, diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index 68c6cf670d5..119964bdabc 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -2,17 +2,18 @@ use asset_test_utils::{ExtBuilder, RuntimeHelper}; use cumulus_primitives_utility::ChargeWeightInFungibles; use frame_support::{ assert_noop, assert_ok, - traits::PalletInfo, weights::{Weight, WeightToFee as WeightToFeeT}, }; use parachains_common::{AccountId, AuraId}; -use westmint_runtime::xcm_config::AssetFeeAsExistentialDepositMultiplierFeeCharger; +use westmint_runtime::xcm_config::{ + AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, +}; pub use westmint_runtime::{ constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, Runtime, SessionKeys, System, }; use xcm::latest::prelude::*; -use xcm_executor::traits::WeightTrader; +use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; @@ -47,16 +48,8 @@ fn test_asset_xcm_trader() { )); // get asset id as multilocation - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(local_asset_id.into()), - ), - ); + let asset_multilocation = + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(); // Set Alice as block author, who will receive fees RuntimeHelper::::run_to_block(2, Some(AccountId::from(ALICE))); @@ -94,12 +87,15 @@ fn test_asset_xcm_trader() { // Make sure author(Alice) has received the amount assert_eq!( - Assets::balance(1, AccountId::from(ALICE)), + Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance + asset_amount_needed ); // We also need to ensure the total supply increased - assert_eq!(Assets::total_supply(1), minimum_asset_balance + asset_amount_needed); + assert_eq!( + Assets::total_supply(local_asset_id), + minimum_asset_balance + asset_amount_needed + ); }); } @@ -139,16 +135,7 @@ fn test_asset_xcm_trader_with_refund() { // We are going to buy 4e9 weight let bought = Weight::from_ref_time(4_000_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); // lets calculate amount needed let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -217,16 +204,7 @@ fn test_asset_xcm_trader_refund_not_possible_since_amount_less_than_ed() { // We are going to buy 5e9 weight let bought = Weight::from_ref_time(500_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -276,16 +254,7 @@ fn test_that_buying_ed_refund_does_not_refund() { let bought = Weight::from_ref_time(500_000_000u64); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let amount_bought = WeightToFee::weight_to_fee(&bought); @@ -360,16 +329,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { // lets calculate amount needed let asset_amount_needed = WeightToFee::weight_to_fee(&bought); - let asset_multilocation = MultiLocation::new( - 0, - X2( - PalletInstance( - ::PalletInfo::index::().unwrap() - as u8, - ), - GeneralIndex(1), - ), - ); + let asset_multilocation = AssetIdForTrustBackedAssetsConvert::reverse_ref(1).unwrap(); let asset: MultiAsset = (asset_multilocation, asset_amount_needed).into(); @@ -386,3 +346,54 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { assert_eq!(Assets::total_supply(1), minimum_asset_balance); }); } + +#[test] +fn test_assets_balances_api_works() { + use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + + ExtBuilder::::default() + .with_collators(vec![AccountId::from(ALICE)]) + .with_session_keys(vec![( + AccountId::from(ALICE), + AccountId::from(ALICE), + SessionKeys { aura: AuraId::from(sp_core::sr25519::Public::from_raw(ALICE)) }, + )]) + .build() + .execute_with(|| { + let local_asset_id = 1; + + // check before + assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); + assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // We need root origin to create a sufficient asset + let minimum_asset_balance = 3333333_u128; + assert_ok!(Assets::force_create( + RuntimeHelper::::root_origin(), + local_asset_id.into(), + AccountId::from(ALICE).into(), + true, + minimum_asset_balance + )); + + // We first mint enough asset for the account to exist for assets + assert_ok!(Assets::mint( + RuntimeHelper::::origin_of(AccountId::from(ALICE)), + local_asset_id.into(), + AccountId::from(ALICE).into(), + minimum_asset_balance + )); + + // check after + assert_eq!( + Assets::balance(local_asset_id, AccountId::from(ALICE)), + minimum_asset_balance + ); + let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 1); + assert!(result.iter().any(|asset| asset.eq(&( + AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), + minimum_asset_balance + )))); + }); +} From 139da1a71ace5714261541d9f01a27974dae3dab Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 15 Feb 2023 11:16:24 +0100 Subject: [PATCH 04/15] typo for check-docs job --- parachains/runtimes/assets/common/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 4ed04c73118..d7d09a49c86 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -23,7 +23,7 @@ use xcm::latest::MultiLocation; use xcm_builder::AsPrefixedGeneralIndex; use xcm_executor::traits::{Convert, JustTry}; -/// [`MultiLocation`] converter for [`TrustBackedAssets`]'s [`AssetIdForTrustBackedAssets`] +/// [`MultiLocation`] vs [`AssetIdForTrustBackedAssets`] converter for `TrustBackedAssets` pub type AssetIdForTrustBackedAssetsConvert = AsPrefixedGeneralIndex; From a409db45cc2d779739133a1a3f8aa9a334d85515 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Wed, 22 Feb 2023 00:32:29 +0100 Subject: [PATCH 05/15] WIP: AssetsApi return MultiAsset instead of (MultiLocation, Balance) --- .../runtimes/assets/common/src/assets_api.rs | 30 ++++++++++++++++--- parachains/runtimes/assets/common/src/lib.rs | 21 +------------ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/parachains/runtimes/assets/common/src/assets_api.rs b/parachains/runtimes/assets/common/src/assets_api.rs index 05e69e2546d..3dba25bd3bb 100644 --- a/parachains/runtimes/assets/common/src/assets_api.rs +++ b/parachains/runtimes/assets/common/src/assets_api.rs @@ -21,22 +21,44 @@ use codec::{Codec, Decode, Encode}; use frame_support::RuntimeDebug; use sp_std::vec::Vec; +use xcm::latest::{MultiAsset, MultiLocation}; +use xcm_executor::traits::Convert; /// The possible errors that can happen querying the storage of assets. #[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] pub enum AssetsAccessError { /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. AssetIdConversionFailed, + /// `u128` amount to currency `Balance` conversion failed. + AmountToBalanceConversionFailed, +} + +/// Helper function to convert collections with (`AssetId`, 'Balance') to (`MultiAsset`) +pub fn convert_asset( + assets_balances: Vec<(AssetId, Balance)>, +) -> Result, AssetsAccessError> +where + ConvertAssetId: Convert, + ConvertBalance: Convert, +{ + assets_balances + .into_iter() + .map(|(asset_id, balance)| match ConvertAssetId::reverse_ref(asset_id) { + Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { + Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), + Err(_) => Err(AssetsAccessError::AmountToBalanceConversionFailed), + }, + Err(_) => Err(AssetsAccessError::AssetIdConversionFailed), + }) + .collect() } sp_api::decl_runtime_apis! { - pub trait AssetsApi + pub trait AssetsApi where AccountId: Codec, - AssetBalance: Codec, - AssetId: Codec, { /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. - fn account_balances(account: AccountId) -> Result, AssetsAccessError>; + fn query_account_balances(account: AccountId) -> Result, AssetsAccessError>; } } diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index d7d09a49c86..a2ede143406 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -18,32 +18,13 @@ pub mod assets_api; use parachains_common::AssetIdForTrustBackedAssets; -use sp_std::prelude::Vec; -use xcm::latest::MultiLocation; use xcm_builder::AsPrefixedGeneralIndex; -use xcm_executor::traits::{Convert, JustTry}; +use xcm_executor::traits::JustTry; /// [`MultiLocation`] vs [`AssetIdForTrustBackedAssets`] converter for `TrustBackedAssets` pub type AssetIdForTrustBackedAssetsConvert = AsPrefixedGeneralIndex; -/// Helper function to convert collections with (`AssetId`, 'Balance') to (`MultiLocation`, 'Balance') -pub fn convert_asset_id( - assets_balances: Vec<(AssetId, Balance)>, -) -> Result, assets_api::AssetsAccessError> -where - ConvertAssetId: Convert, -{ - assets_balances - .into_iter() - .map(|(asset_id, balance)| { - ConvertAssetId::reverse_ref(asset_id) - .map(|converted_asset_id| (converted_asset_id, balance)) - .map_err(|_| assets_api::AssetsAccessError::AssetIdConversionFailed) - }) - .collect() -} - #[cfg(test)] mod tests { From 9d2390a491f0abc061b8a6e7878fe5872b3753c0 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 23 Feb 2023 11:54:25 +0100 Subject: [PATCH 06/15] WIP: assets_api + conversion refactor --- .../runtimes/assets/common/src/assets_api.rs | 119 +++++++++++++++--- parachains/runtimes/assets/common/src/lib.rs | 12 +- 2 files changed, 110 insertions(+), 21 deletions(-) diff --git a/parachains/runtimes/assets/common/src/assets_api.rs b/parachains/runtimes/assets/common/src/assets_api.rs index 3dba25bd3bb..c7a99a36c5e 100644 --- a/parachains/runtimes/assets/common/src/assets_api.rs +++ b/parachains/runtimes/assets/common/src/assets_api.rs @@ -20,37 +20,68 @@ use codec::{Codec, Decode, Encode}; use frame_support::RuntimeDebug; -use sp_std::vec::Vec; +use sp_std::{borrow::Borrow, vec::Vec}; use xcm::latest::{MultiAsset, MultiLocation}; -use xcm_executor::traits::Convert; +use xcm_builder::ConvertedConcreteId; +use xcm_executor::traits::{Convert, MatchesFungibles}; -/// The possible errors that can happen querying the storage of assets. -#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] -pub enum AssetsAccessError { - /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. - AssetIdConversionFailed, - /// `u128` amount to currency `Balance` conversion failed. - AmountToBalanceConversionFailed, -} - -/// Helper function to convert collections with (`AssetId`, 'Balance') to (`MultiAsset`) -pub fn convert_asset( - assets_balances: Vec<(AssetId, Balance)>, -) -> Result, AssetsAccessError> +/// Converting any [`(AssetId, Balance)`] to [`MultiAsset`] +// TODO: could be replaced by [`Convert<(AssetId, Balance), MultiAsset>`] and/or move to Polkadot repo [`xcm`] module - issue https://github.com/paritytech/polkadot/pull/6760 +pub trait MultiAssetConverter: + MatchesFungibles where + AssetId: Clone, + Balance: Clone, ConvertAssetId: Convert, ConvertBalance: Convert, { - assets_balances - .into_iter() - .map(|(asset_id, balance)| match ConvertAssetId::reverse_ref(asset_id) { + fn convert_ref(value: impl Borrow<(AssetId, Balance)>) + -> Result; +} + +impl< + AssetId: Clone, + Balance: Clone, + ConvertAssetId: Convert, + ConvertBalance: Convert, + > MultiAssetConverter + for ConvertedConcreteId +{ + fn convert_ref( + value: impl Borrow<(AssetId, Balance)>, + ) -> Result { + let (asset_id, balance) = value.borrow(); + match ConvertAssetId::reverse_ref(asset_id) { Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), Err(_) => Err(AssetsAccessError::AmountToBalanceConversionFailed), }, Err(_) => Err(AssetsAccessError::AssetIdConversionFailed), - }) - .collect() + } + } +} + +/// Helper function to convert collections with [`(AssetId, Balance)`] to [`MultiAsset`] +pub fn convert<'a, AssetId, Balance, ConvertAssetId, ConvertBalance, Converter>( + items: impl Iterator, +) -> Result, AssetsAccessError> +where + AssetId: Clone + 'a, + Balance: Clone + 'a, + ConvertAssetId: Convert, + ConvertBalance: Convert, + Converter: MultiAssetConverter, +{ + items.map(Converter::convert_ref).collect() +} + +/// The possible errors that can happen querying the storage of assets. +#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] +pub enum AssetsAccessError { + /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. + AssetIdConversionFailed, + /// `u128` amount to currency `Balance` conversion failed. + AmountToBalanceConversionFailed, } sp_api::decl_runtime_apis! { @@ -62,3 +93,51 @@ sp_api::decl_runtime_apis! { fn query_account_balances(account: AccountId) -> Result, AssetsAccessError>; } } + +#[cfg(test)] +mod tests { + use super::*; + + use xcm::latest::prelude::*; + use xcm_executor::traits::{Identity, JustTry}; + + type Converter = ConvertedConcreteId; + + #[test] + fn converted_concrete_id_fungible_multi_asset_conversion_roundtrip_works() { + let location = MultiLocation::new(0, X1(GlobalConsensus(ByGenesis([0; 32])))); + let amount = 123456_u64; + let expected_multi_asset = MultiAsset { + id: Concrete(MultiLocation::new(0, X1(GlobalConsensus(ByGenesis([0; 32]))))), + fun: Fungible(123456_u128), + }; + + assert_eq!( + Converter::matches_fungibles(&expected_multi_asset).map_err(|_| ()), + Ok((location, amount)) + ); + + assert_eq!(Converter::convert_ref((location, amount)), Ok(expected_multi_asset)); + } + + #[test] + fn converted_concrete_id_fungible_multi_asset_conversion_collection_works() { + let data = vec![ + (MultiLocation::new(0, X1(GlobalConsensus(ByGenesis([0; 32])))), 123456_u64), + (MultiLocation::new(1, X1(GlobalConsensus(ByGenesis([1; 32])))), 654321_u64), + ]; + + let expected_data = vec![ + MultiAsset { + id: Concrete(MultiLocation::new(0, X1(GlobalConsensus(ByGenesis([0; 32]))))), + fun: Fungible(123456_u128), + }, + MultiAsset { + id: Concrete(MultiLocation::new(1, X1(GlobalConsensus(ByGenesis([1; 32]))))), + fun: Fungible(654321_u128), + }, + ]; + + assert_eq!(convert::<_, _, _, _, Converter>(data.iter()), Ok(expected_data)); + } +} diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index a2ede143406..47332ca125b 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -18,18 +18,28 @@ pub mod assets_api; use parachains_common::AssetIdForTrustBackedAssets; -use xcm_builder::AsPrefixedGeneralIndex; +use xcm_builder::{AsPrefixedGeneralIndex, ConvertedConcreteId}; use xcm_executor::traits::JustTry; /// [`MultiLocation`] vs [`AssetIdForTrustBackedAssets`] converter for `TrustBackedAssets` pub type AssetIdForTrustBackedAssetsConvert = AsPrefixedGeneralIndex; +/// [`ConvertedConcreteId`] converter dedicated for [`TrustBackedAssets`] +pub type TrustBackedAssetsConvertedConcreteId = + ConvertedConcreteId< + AssetIdForTrustBackedAssets, + Balance, + AssetIdForTrustBackedAssetsConvert, + JustTry, + >; + #[cfg(test)] mod tests { use super::*; use xcm::latest::prelude::*; + use xcm_executor::traits::Convert; frame_support::parameter_types! { pub TrustBackedAssetsPalletLocation: MultiLocation = MultiLocation::new(5, X1(PalletInstance(13))); From a9f5fdd3cd59bb3acb2327dd5b674482aacaf9b2 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 23 Feb 2023 13:46:14 +0100 Subject: [PATCH 07/15] WIP: assets_api + conversion refactor --- .../runtimes/assets/common/src/assets_api.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/parachains/runtimes/assets/common/src/assets_api.rs b/parachains/runtimes/assets/common/src/assets_api.rs index c7a99a36c5e..2b7388b42cf 100644 --- a/parachains/runtimes/assets/common/src/assets_api.rs +++ b/parachains/runtimes/assets/common/src/assets_api.rs @@ -75,6 +75,19 @@ where items.map(Converter::convert_ref).collect() } +/// Helper function to convert [`Balance`] with [`MultiLocation`] to [`MultiAsset`] +pub fn convert_balance< + T: frame_support::pallet_prelude::Get, + Balance: TryInto, +>( + balance: Balance, +) -> Result { + match balance.try_into() { + Ok(balance) => Ok((T::get(), balance).into()), + Err(_) => Err(AssetsAccessError::AmountToBalanceConversionFailed), + } +} + /// The possible errors that can happen querying the storage of assets. #[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] pub enum AssetsAccessError { @@ -89,7 +102,7 @@ sp_api::decl_runtime_apis! { where AccountId: Codec, { - /// Returns the list of `AssetId`s and corresponding balance that an `AccountId` has. + /// Returns the list of all [`MultiAsset`] that an `AccountId` has. fn query_account_balances(account: AccountId) -> Result, AssetsAccessError>; } } From 33218cf434d405eb923d482b9481fbbbc3fa1b15 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 23 Feb 2023 14:08:43 +0100 Subject: [PATCH 08/15] Finished asset runtimes --- .../runtimes/assets/statemine/src/lib.rs | 24 +++++++++--- .../assets/statemine/src/xcm_config.rs | 37 ++++++------------ .../runtimes/assets/statemine/tests/tests.rs | 31 ++++++++++++--- .../runtimes/assets/statemint/src/lib.rs | 24 +++++++++--- .../assets/statemint/src/xcm_config.rs | 37 ++++++------------ .../runtimes/assets/statemint/tests/tests.rs | 31 ++++++++++++--- .../runtimes/assets/westmint/src/lib.rs | 25 +++++++++--- .../assets/westmint/src/xcm_config.rs | 37 ++++++------------ .../runtimes/assets/westmint/tests/tests.rs | 38 +++++++++++++++---- 9 files changed, 174 insertions(+), 110 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index 6e8702ff11f..e74abea81d4 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -64,7 +64,7 @@ use parachains_common::{ Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; -use xcm_config::{AssetIdForTrustBackedAssetsConvert, KsmLocation, XcmConfig}; +use xcm_config::{KsmLocation, TrustBackedAssetsConvertedConcreteId, XcmConfig}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -834,13 +834,27 @@ impl_runtime_apis! { impl assets_common::assets_api::AssetsApi< Block, AccountId, - Balance, - xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + use assets_common::assets_api::{convert, convert_balance}; Ok([ - assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + // collect pallet_balance + { + let balance = Balances::free_balance(account.clone()); + if balance > 0 { + vec![convert_balance::(balance)?] + } else { + vec![] + } + }, + // collect pallet_assets (TrustBackedAssets) + convert::<_, _, _, _, TrustBackedAssetsConvertedConcreteId>( + Assets::account_balances(account) + .iter() + .filter(|(_, balance)| balance > &0) + )?, + // collect ... e.g. pallet_assets ForeignAssets ].concat()) } } diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 6038560a5ce..2d2148e5386 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -14,9 +14,9 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, AssetIdForTrustBackedAssets, Assets, Authorship, Balance, - Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -34,16 +34,13 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, - EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm_executor::{ - traits::{JustTry, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; parameter_types! { pub const KsmLocation: MultiLocation = MultiLocation::parent(); @@ -83,21 +80,16 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] -pub type AssetIdForTrustBackedAssetsConvert = - assets_common::AssetIdForTrustBackedAssetsConvert; +/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +pub type TrustBackedAssetsConvertedConcreteId = + assets_common::TrustBackedAssetsConvertedConcreteId; /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, // Convert an XCM MultiLocation into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -301,12 +293,7 @@ impl xcm_executor::Config for XcmConfig { cumulus_primitives_utility::TakeFirstAssetTrader< AccountId, AssetFeeAsExistentialDepositMultiplierFeeCharger, - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, Assets, cumulus_primitives_utility::XcmFeesTo32ByteAccount< FungiblesTransactor, diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index 610f7e75723..1488be9574f 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -4,9 +4,9 @@ use frame_support::{ assert_noop, assert_ok, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, AuraId}; +use parachains_common::{AccountId, AuraId, Balance}; use statemine_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, + AssetFeeAsExistentialDepositMultiplierFeeCharger, KsmLocation, TrustBackedAssetsPalletLocation, }; pub use statemine_runtime::{ constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, @@ -17,6 +17,9 @@ use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; +type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + #[test] fn test_asset_xcm_trader() { ExtBuilder::::default() @@ -366,7 +369,13 @@ fn test_assets_balances_api_works() { // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); - assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); + assert!(Runtime::query_account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // Drip some balance + use frame_support::traits::fungible::Mutate; + let some_currency = ExistentialDeposit::get(); + Balances::mint_into(&AccountId::from(ALICE), some_currency).unwrap(); // We need root origin to create a sufficient asset let minimum_asset_balance = 3333333_u128; @@ -391,11 +400,21 @@ fn test_assets_balances_api_works() { Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance ); - let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); - assert_eq!(result.len(), 1); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); + + let result = Runtime::query_account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 2); + + // check currency + assert!(result.iter().any(|asset| asset.eq( + &assets_common::assets_api::convert_balance::(some_currency) + .unwrap() + ))); + // check trusted asset assert!(result.iter().any(|asset| asset.eq(&( AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), minimum_asset_balance - )))); + ) + .into()))); }); } diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 23bdb8ac669..7ef41810786 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -94,7 +94,7 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - AssetIdForTrustBackedAssetsConvert, DotLocation, XcmConfig, XcmOriginToTransactDispatchOrigin, + DotLocation, TrustBackedAssetsConvertedConcreteId, XcmConfig, XcmOriginToTransactDispatchOrigin, }; #[cfg(any(feature = "std", test))] @@ -833,13 +833,27 @@ impl_runtime_apis! { impl assets_common::assets_api::AssetsApi< Block, AccountId, - Balance, - xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + use assets_common::assets_api::{convert, convert_balance}; Ok([ - assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + // collect pallet_balance + { + let balance = Balances::free_balance(account.clone()); + if balance > 0 { + vec![convert_balance::(balance)?] + } else { + vec![] + } + }, + // collect pallet_assets (TrustBackedAssets) + convert::<_, _, _, _, TrustBackedAssetsConvertedConcreteId>( + Assets::account_balances(account) + .iter() + .filter(|(_, balance)| balance > &0) + )?, + // collect ... e.g. pallet_assets ForeignAssets ].concat()) } } diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index 23358bc34c2..86e3585770b 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -14,9 +14,9 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, AssetIdForTrustBackedAssets, Assets, Authorship, Balance, - Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -34,16 +34,13 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, - EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm_executor::{ - traits::{JustTry, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; parameter_types! { pub const DotLocation: MultiLocation = MultiLocation::parent(); @@ -83,21 +80,16 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] -pub type AssetIdForTrustBackedAssetsConvert = - assets_common::AssetIdForTrustBackedAssetsConvert; +/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +pub type TrustBackedAssetsConvertedConcreteId = + assets_common::TrustBackedAssetsConvertedConcreteId; /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, // Convert an XCM MultiLocation into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -301,12 +293,7 @@ impl xcm_executor::Config for XcmConfig { cumulus_primitives_utility::TakeFirstAssetTrader< AccountId, AssetFeeAsExistentialDepositMultiplierFeeCharger, - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, Assets, cumulus_primitives_utility::XcmFeesTo32ByteAccount< FungiblesTransactor, diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index 33028db5891..10a325324dd 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -4,9 +4,9 @@ use frame_support::{ assert_noop, assert_ok, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, StatemintAuraId as AuraId}; +use parachains_common::{AccountId, Balance, StatemintAuraId as AuraId}; use statemint_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, + AssetFeeAsExistentialDepositMultiplierFeeCharger, DotLocation, TrustBackedAssetsPalletLocation, }; pub use statemint_runtime::{ constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, @@ -17,6 +17,9 @@ use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; +type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + #[test] fn test_asset_xcm_trader() { ExtBuilder::::default() @@ -378,7 +381,13 @@ fn test_assets_balances_api_works() { // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); - assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); + assert!(Runtime::query_account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // Drip some balance + use frame_support::traits::fungible::Mutate; + let some_currency = ExistentialDeposit::get(); + Balances::mint_into(&AccountId::from(ALICE), some_currency).unwrap(); // We need root origin to create a sufficient asset let minimum_asset_balance = 3333333_u128; @@ -403,11 +412,21 @@ fn test_assets_balances_api_works() { Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance ); - let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); - assert_eq!(result.len(), 1); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); + + let result = Runtime::query_account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 2); + + // check currency + assert!(result.iter().any(|asset| asset.eq( + &assets_common::assets_api::convert_balance::(some_currency) + .unwrap() + ))); + // check trusted asset assert!(result.iter().any(|asset| asset.eq(&( AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), minimum_asset_balance - )))); + ) + .into()))); }); } diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index 71f560b770b..fb0ee11e317 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -66,7 +66,8 @@ use parachains_common::{ NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ - AssetIdForTrustBackedAssetsConvert, XcmConfig, XcmOriginToTransactDispatchOrigin, + TrustBackedAssetsConvertedConcreteId, WestendLocation, XcmConfig, + XcmOriginToTransactDispatchOrigin, }; #[cfg(any(feature = "std", test))] @@ -848,13 +849,27 @@ impl_runtime_apis! { impl assets_common::assets_api::AssetsApi< Block, AccountId, - Balance, - xcm::latest::MultiLocation, > for Runtime { - fn account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { + use assets_common::assets_api::{convert, convert_balance}; Ok([ - assets_common::convert_asset_id::<_, _, AssetIdForTrustBackedAssetsConvert>(Assets::account_balances(account))?, + // collect pallet_balance + { + let balance = Balances::free_balance(account.clone()); + if balance > 0 { + vec![convert_balance::(balance)?] + } else { + vec![] + } + }, + // collect pallet_assets (TrustBackedAssets) + convert::<_, _, _, _, TrustBackedAssetsConvertedConcreteId>( + Assets::account_balances(account) + .iter() + .filter(|(_, balance)| balance > &0) + )?, + // collect ... e.g. pallet_assets ForeignAssets ].concat()) } } diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 3e94e3ab161..996ae3d4792 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -14,9 +14,9 @@ // limitations under the License. use super::{ - AccountId, AllPalletsWithSystem, AssetIdForTrustBackedAssets, Assets, Authorship, Balance, - Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, - RuntimeOrigin, TrustBackedAssetsInstance, WeightToFee, XcmpQueue, + AccountId, AllPalletsWithSystem, Assets, Authorship, Balance, Balances, ParachainInfo, + ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, + TrustBackedAssetsInstance, WeightToFee, XcmpQueue, }; use frame_support::{ match_types, parameter_types, @@ -34,16 +34,13 @@ use sp_runtime::traits::ConvertInto; use xcm::latest::prelude::*; use xcm_builder::{ AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowKnownQueryResponses, - AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, ConvertedConcreteId, CurrencyAdapter, - EnsureXcmOrigin, FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, - ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, + AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, + FungiblesAdapter, IsConcrete, LocalMint, NativeAsset, ParentAsSuperuser, ParentIsPreset, + RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds, WithComputedOrigin, }; -use xcm_executor::{ - traits::{JustTry, WithOriginFilter}, - XcmExecutor, -}; +use xcm_executor::{traits::WithOriginFilter, XcmExecutor}; parameter_types! { pub const WestendLocation: MultiLocation = MultiLocation::parent(); @@ -83,21 +80,16 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId` converter for [`AssetIdForTrustBackedAssets`] -pub type AssetIdForTrustBackedAssetsConvert = - assets_common::AssetIdForTrustBackedAssetsConvert; +/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +pub type TrustBackedAssetsConvertedConcreteId = + assets_common::TrustBackedAssetsConvertedConcreteId; /// Means for transacting assets besides the native currency on this chain. pub type FungiblesTransactor = FungiblesAdapter< // Use this fungibles implementation: Assets, // Use this currency when it is a fungible asset matching the given location or name: - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, // Convert an XCM MultiLocation into a local account id: LocationToAccountId, // Our chain's account ID type (we can't get away without mentioning it explicitly): @@ -296,12 +288,7 @@ impl xcm_executor::Config for XcmConfig { cumulus_primitives_utility::TakeFirstAssetTrader< AccountId, AssetFeeAsExistentialDepositMultiplierFeeCharger, - ConvertedConcreteId< - AssetIdForTrustBackedAssets, - Balance, - AssetIdForTrustBackedAssetsConvert, - JustTry, - >, + TrustBackedAssetsConvertedConcreteId, Assets, cumulus_primitives_utility::XcmFeesTo32ByteAccount< FungiblesTransactor, diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index 119964bdabc..8e698a374d4 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -4,19 +4,23 @@ use frame_support::{ assert_noop, assert_ok, weights::{Weight, WeightToFee as WeightToFeeT}, }; -use parachains_common::{AccountId, AuraId}; +use parachains_common::{AccountId, AuraId, Balance}; use westmint_runtime::xcm_config::{ - AssetFeeAsExistentialDepositMultiplierFeeCharger, AssetIdForTrustBackedAssetsConvert, + AssetFeeAsExistentialDepositMultiplierFeeCharger, WestendLocation, }; pub use westmint_runtime::{ - constants::fee::WeightToFee, xcm_config::XcmConfig, Assets, Balances, ExistentialDeposit, - Runtime, SessionKeys, System, + constants::fee::WeightToFee, + xcm_config::{TrustBackedAssetsPalletLocation, XcmConfig}, + Assets, Balances, ExistentialDeposit, Runtime, SessionKeys, System, }; use xcm::latest::prelude::*; use xcm_executor::traits::{Convert, WeightTrader}; pub const ALICE: [u8; 32] = [1u8; 32]; +type AssetIdForTrustBackedAssetsConvert = + assets_common::AssetIdForTrustBackedAssetsConvert; + #[test] fn test_asset_xcm_trader() { ExtBuilder::::default() @@ -364,7 +368,13 @@ fn test_assets_balances_api_works() { // check before assert_eq!(Assets::balance(local_asset_id, AccountId::from(ALICE)), 0); - assert!(Runtime::account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), 0); + assert!(Runtime::query_account_balances(AccountId::from(ALICE)).unwrap().is_empty()); + + // Drip some balance + use frame_support::traits::fungible::Mutate; + let some_currency = ExistentialDeposit::get(); + Balances::mint_into(&AccountId::from(ALICE), some_currency).unwrap(); // We need root origin to create a sufficient asset let minimum_asset_balance = 3333333_u128; @@ -389,11 +399,23 @@ fn test_assets_balances_api_works() { Assets::balance(local_asset_id, AccountId::from(ALICE)), minimum_asset_balance ); - let result = Runtime::account_balances(AccountId::from(ALICE)).unwrap(); - assert_eq!(result.len(), 1); + assert_eq!(Balances::free_balance(AccountId::from(ALICE)), some_currency); + + let result = Runtime::query_account_balances(AccountId::from(ALICE)).unwrap(); + assert_eq!(result.len(), 2); + + // check currency + assert!(result.iter().any(|asset| asset.eq( + &assets_common::assets_api::convert_balance::( + some_currency + ) + .unwrap() + ))); + // check trusted asset assert!(result.iter().any(|asset| asset.eq(&( AssetIdForTrustBackedAssetsConvert::reverse_ref(local_asset_id).unwrap(), minimum_asset_balance - )))); + ) + .into()))); }); } From 958b97867c72a61120bc3927074fdabd1ae63573 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 26 Feb 2023 22:20:16 +0100 Subject: [PATCH 09/15] Refactor AssetsApi to FungiblesApi --- .../{assets_api.rs => fungible_conversion.rs} | 36 ++++------------ parachains/runtimes/assets/common/src/lib.rs | 3 +- .../runtimes/assets/common/src/runtime_api.rs | 43 +++++++++++++++++++ 3 files changed, 53 insertions(+), 29 deletions(-) rename parachains/runtimes/assets/common/src/{assets_api.rs => fungible_conversion.rs} (80%) create mode 100644 parachains/runtimes/assets/common/src/runtime_api.rs diff --git a/parachains/runtimes/assets/common/src/assets_api.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs similarity index 80% rename from parachains/runtimes/assets/common/src/assets_api.rs rename to parachains/runtimes/assets/common/src/fungible_conversion.rs index 2b7388b42cf..e3f261c244c 100644 --- a/parachains/runtimes/assets/common/src/assets_api.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -18,8 +18,7 @@ //! Runtime API definition for assets. -use codec::{Codec, Decode, Encode}; -use frame_support::RuntimeDebug; +use crate::runtime_api::FungiblesAccessError; use sp_std::{borrow::Borrow, vec::Vec}; use xcm::latest::{MultiAsset, MultiLocation}; use xcm_builder::ConvertedConcreteId; @@ -36,7 +35,7 @@ where ConvertBalance: Convert, { fn convert_ref(value: impl Borrow<(AssetId, Balance)>) - -> Result; + -> Result; } impl< @@ -49,14 +48,14 @@ impl< { fn convert_ref( value: impl Borrow<(AssetId, Balance)>, - ) -> Result { + ) -> Result { let (asset_id, balance) = value.borrow(); match ConvertAssetId::reverse_ref(asset_id) { Ok(asset_id_as_multilocation) => match ConvertBalance::reverse_ref(balance) { Ok(amount) => Ok((asset_id_as_multilocation, amount).into()), - Err(_) => Err(AssetsAccessError::AmountToBalanceConversionFailed), + Err(_) => Err(FungiblesAccessError::AmountToBalanceConversionFailed), }, - Err(_) => Err(AssetsAccessError::AssetIdConversionFailed), + Err(_) => Err(FungiblesAccessError::AssetIdConversionFailed), } } } @@ -64,7 +63,7 @@ impl< /// Helper function to convert collections with [`(AssetId, Balance)`] to [`MultiAsset`] pub fn convert<'a, AssetId, Balance, ConvertAssetId, ConvertBalance, Converter>( items: impl Iterator, -) -> Result, AssetsAccessError> +) -> Result, FungiblesAccessError> where AssetId: Clone + 'a, Balance: Clone + 'a, @@ -81,29 +80,10 @@ pub fn convert_balance< Balance: TryInto, >( balance: Balance, -) -> Result { +) -> Result { match balance.try_into() { Ok(balance) => Ok((T::get(), balance).into()), - Err(_) => Err(AssetsAccessError::AmountToBalanceConversionFailed), - } -} - -/// The possible errors that can happen querying the storage of assets. -#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] -pub enum AssetsAccessError { - /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. - AssetIdConversionFailed, - /// `u128` amount to currency `Balance` conversion failed. - AmountToBalanceConversionFailed, -} - -sp_api::decl_runtime_apis! { - pub trait AssetsApi - where - AccountId: Codec, - { - /// Returns the list of all [`MultiAsset`] that an `AccountId` has. - fn query_account_balances(account: AccountId) -> Result, AssetsAccessError>; + Err(_) => Err(FungiblesAccessError::AmountToBalanceConversionFailed), } } diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 47332ca125b..32133919453 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -15,7 +15,8 @@ #![cfg_attr(not(feature = "std"), no_std)] -pub mod assets_api; +pub mod fungible_conversion; +pub mod runtime_api; use parachains_common::AssetIdForTrustBackedAssets; use xcm_builder::{AsPrefixedGeneralIndex, ConvertedConcreteId}; diff --git a/parachains/runtimes/assets/common/src/runtime_api.rs b/parachains/runtimes/assets/common/src/runtime_api.rs new file mode 100644 index 00000000000..65f42fcfac1 --- /dev/null +++ b/parachains/runtimes/assets/common/src/runtime_api.rs @@ -0,0 +1,43 @@ +// Copyright (C) 2023 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Runtime API definition for fungibles. +//! +//! (Initial version: https://github.com/paritytech/cumulus/pull/2180#issuecomment-1442952274) + +use frame_support::RuntimeDebug; +use codec::{Codec, Decode, Encode}; +use sp_std::vec::Vec; +use xcm::latest::MultiAsset; + +/// The possible errors that can happen querying the storage of assets. +#[derive(Eq, PartialEq, Encode, Decode, RuntimeDebug)] +pub enum FungiblesAccessError { + /// `MultiLocation` to `AssetId`/`ClassId` conversion failed. + AssetIdConversionFailed, + /// `u128` amount to currency `Balance` conversion failed. + AmountToBalanceConversionFailed, +} + +sp_api::decl_runtime_apis! { + /// The API for querying account's balances from runtime. + pub trait FungiblesApi + where + AccountId: Codec, + { + /// Returns the list of all [`MultiAsset`] that an `AccountId` has. + fn query_account_balances(account: AccountId) -> Result, FungiblesAccessError>; + } +} From 170d8691e239be971ccbb03aee85c0062c93c645 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 26 Feb 2023 22:27:13 +0100 Subject: [PATCH 10/15] Refactor --- .../runtimes/assets/common/src/fungible_conversion.rs | 5 +++-- parachains/runtimes/assets/common/src/runtime_api.rs | 2 +- parachains/runtimes/assets/statemine/src/lib.rs | 6 +++--- parachains/runtimes/assets/statemine/tests/tests.rs | 8 +++++--- parachains/runtimes/assets/statemint/src/lib.rs | 6 +++--- parachains/runtimes/assets/statemint/tests/tests.rs | 8 +++++--- parachains/runtimes/assets/westmint/src/lib.rs | 6 +++--- parachains/runtimes/assets/westmint/tests/tests.rs | 4 ++-- 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index e3f261c244c..017afa27cbc 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -34,8 +34,9 @@ where ConvertAssetId: Convert, ConvertBalance: Convert, { - fn convert_ref(value: impl Borrow<(AssetId, Balance)>) - -> Result; + fn convert_ref( + value: impl Borrow<(AssetId, Balance)>, + ) -> Result; } impl< diff --git a/parachains/runtimes/assets/common/src/runtime_api.rs b/parachains/runtimes/assets/common/src/runtime_api.rs index 65f42fcfac1..2dc30f46cf7 100644 --- a/parachains/runtimes/assets/common/src/runtime_api.rs +++ b/parachains/runtimes/assets/common/src/runtime_api.rs @@ -17,8 +17,8 @@ //! //! (Initial version: https://github.com/paritytech/cumulus/pull/2180#issuecomment-1442952274) -use frame_support::RuntimeDebug; use codec::{Codec, Decode, Encode}; +use frame_support::RuntimeDebug; use sp_std::vec::Vec; use xcm::latest::MultiAsset; diff --git a/parachains/runtimes/assets/statemine/src/lib.rs b/parachains/runtimes/assets/statemine/src/lib.rs index e74abea81d4..dacae893b01 100644 --- a/parachains/runtimes/assets/statemine/src/lib.rs +++ b/parachains/runtimes/assets/statemine/src/lib.rs @@ -831,13 +831,13 @@ impl_runtime_apis! { } } - impl assets_common::assets_api::AssetsApi< + impl assets_common::runtime_api::FungiblesApi< Block, AccountId, > for Runtime { - fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { - use assets_common::assets_api::{convert, convert_balance}; + fn query_account_balances(account: AccountId) -> Result, assets_common::runtime_api::FungiblesAccessError> { + use assets_common::fungible_conversion::{convert, convert_balance}; Ok([ // collect pallet_balance { diff --git a/parachains/runtimes/assets/statemine/tests/tests.rs b/parachains/runtimes/assets/statemine/tests/tests.rs index 1488be9574f..1a08737dd65 100644 --- a/parachains/runtimes/assets/statemine/tests/tests.rs +++ b/parachains/runtimes/assets/statemine/tests/tests.rs @@ -354,7 +354,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { #[test] fn test_assets_balances_api_works() { - use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + use assets_common::runtime_api::runtime_decl_for_FungiblesApi::FungiblesApi; ExtBuilder::::default() .with_collators(vec![AccountId::from(ALICE)]) @@ -407,8 +407,10 @@ fn test_assets_balances_api_works() { // check currency assert!(result.iter().any(|asset| asset.eq( - &assets_common::assets_api::convert_balance::(some_currency) - .unwrap() + &assets_common::fungible_conversion::convert_balance::( + some_currency + ) + .unwrap() ))); // check trusted asset assert!(result.iter().any(|asset| asset.eq(&( diff --git a/parachains/runtimes/assets/statemint/src/lib.rs b/parachains/runtimes/assets/statemint/src/lib.rs index 7ef41810786..b9050cdc83c 100644 --- a/parachains/runtimes/assets/statemint/src/lib.rs +++ b/parachains/runtimes/assets/statemint/src/lib.rs @@ -830,13 +830,13 @@ impl_runtime_apis! { } } - impl assets_common::assets_api::AssetsApi< + impl assets_common::runtime_api::FungiblesApi< Block, AccountId, > for Runtime { - fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { - use assets_common::assets_api::{convert, convert_balance}; + fn query_account_balances(account: AccountId) -> Result, assets_common::runtime_api::FungiblesAccessError> { + use assets_common::fungible_conversion::{convert, convert_balance}; Ok([ // collect pallet_balance { diff --git a/parachains/runtimes/assets/statemint/tests/tests.rs b/parachains/runtimes/assets/statemint/tests/tests.rs index 10a325324dd..0dea315a7ce 100644 --- a/parachains/runtimes/assets/statemint/tests/tests.rs +++ b/parachains/runtimes/assets/statemint/tests/tests.rs @@ -366,7 +366,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { #[test] fn test_assets_balances_api_works() { - use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + use assets_common::runtime_api::runtime_decl_for_FungiblesApi::FungiblesApi; ExtBuilder::::default() .with_collators(vec![AccountId::from(ALICE)]) @@ -419,8 +419,10 @@ fn test_assets_balances_api_works() { // check currency assert!(result.iter().any(|asset| asset.eq( - &assets_common::assets_api::convert_balance::(some_currency) - .unwrap() + &assets_common::fungible_conversion::convert_balance::( + some_currency + ) + .unwrap() ))); // check trusted asset assert!(result.iter().any(|asset| asset.eq(&( diff --git a/parachains/runtimes/assets/westmint/src/lib.rs b/parachains/runtimes/assets/westmint/src/lib.rs index fb0ee11e317..2f738cb92f0 100644 --- a/parachains/runtimes/assets/westmint/src/lib.rs +++ b/parachains/runtimes/assets/westmint/src/lib.rs @@ -846,13 +846,13 @@ impl_runtime_apis! { } } - impl assets_common::assets_api::AssetsApi< + impl assets_common::runtime_api::FungiblesApi< Block, AccountId, > for Runtime { - fn query_account_balances(account: AccountId) -> Result, assets_common::assets_api::AssetsAccessError> { - use assets_common::assets_api::{convert, convert_balance}; + fn query_account_balances(account: AccountId) -> Result, assets_common::runtime_api::FungiblesAccessError> { + use assets_common::fungible_conversion::{convert, convert_balance}; Ok([ // collect pallet_balance { diff --git a/parachains/runtimes/assets/westmint/tests/tests.rs b/parachains/runtimes/assets/westmint/tests/tests.rs index 8e698a374d4..59e29bc91e7 100644 --- a/parachains/runtimes/assets/westmint/tests/tests.rs +++ b/parachains/runtimes/assets/westmint/tests/tests.rs @@ -353,7 +353,7 @@ fn test_asset_xcm_trader_not_possible_for_non_sufficient_assets() { #[test] fn test_assets_balances_api_works() { - use assets_common::assets_api::runtime_decl_for_AssetsApi::AssetsApi; + use assets_common::runtime_api::runtime_decl_for_FungiblesApi::FungiblesApi; ExtBuilder::::default() .with_collators(vec![AccountId::from(ALICE)]) @@ -406,7 +406,7 @@ fn test_assets_balances_api_works() { // check currency assert!(result.iter().any(|asset| asset.eq( - &assets_common::assets_api::convert_balance::( + &assets_common::fungible_conversion::convert_balance::( some_currency ) .unwrap() From 32bdfcf3f7d3e0a47103e081621961135ded3c99 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 26 Feb 2023 23:36:37 +0100 Subject: [PATCH 11/15] Fix check-rust-docs --- parachains/runtimes/assets/common/src/fungible_conversion.rs | 2 +- parachains/runtimes/assets/common/src/lib.rs | 4 ++-- parachains/runtimes/assets/common/src/runtime_api.rs | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index 017afa27cbc..77ef32ef685 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -75,7 +75,7 @@ where items.map(Converter::convert_ref).collect() } -/// Helper function to convert [`Balance`] with [`MultiLocation`] to [`MultiAsset`] +/// Helper function to convert `Balance` with MultiLocation` to `MultiAsset` pub fn convert_balance< T: frame_support::pallet_prelude::Get, Balance: TryInto, diff --git a/parachains/runtimes/assets/common/src/lib.rs b/parachains/runtimes/assets/common/src/lib.rs index 32133919453..28d8ca59106 100644 --- a/parachains/runtimes/assets/common/src/lib.rs +++ b/parachains/runtimes/assets/common/src/lib.rs @@ -22,11 +22,11 @@ use parachains_common::AssetIdForTrustBackedAssets; use xcm_builder::{AsPrefixedGeneralIndex, ConvertedConcreteId}; use xcm_executor::traits::JustTry; -/// [`MultiLocation`] vs [`AssetIdForTrustBackedAssets`] converter for `TrustBackedAssets` +/// `MultiLocation` vs `AssetIdForTrustBackedAssets` converter for `TrustBackedAssets` pub type AssetIdForTrustBackedAssetsConvert = AsPrefixedGeneralIndex; -/// [`ConvertedConcreteId`] converter dedicated for [`TrustBackedAssets`] +/// [`ConvertedConcreteId`] converter dedicated for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = ConvertedConcreteId< AssetIdForTrustBackedAssets, diff --git a/parachains/runtimes/assets/common/src/runtime_api.rs b/parachains/runtimes/assets/common/src/runtime_api.rs index 2dc30f46cf7..6d060f22687 100644 --- a/parachains/runtimes/assets/common/src/runtime_api.rs +++ b/parachains/runtimes/assets/common/src/runtime_api.rs @@ -14,8 +14,6 @@ // limitations under the License. //! Runtime API definition for fungibles. -//! -//! (Initial version: https://github.com/paritytech/cumulus/pull/2180#issuecomment-1442952274) use codec::{Codec, Decode, Encode}; use frame_support::RuntimeDebug; From 9d52fa692f3a378a01bfd9cb067660890d712019 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 26 Feb 2023 23:38:58 +0100 Subject: [PATCH 12/15] Removed todo --- parachains/runtimes/assets/common/src/fungible_conversion.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/parachains/runtimes/assets/common/src/fungible_conversion.rs b/parachains/runtimes/assets/common/src/fungible_conversion.rs index 77ef32ef685..2b8413cfe6e 100644 --- a/parachains/runtimes/assets/common/src/fungible_conversion.rs +++ b/parachains/runtimes/assets/common/src/fungible_conversion.rs @@ -25,7 +25,6 @@ use xcm_builder::ConvertedConcreteId; use xcm_executor::traits::{Convert, MatchesFungibles}; /// Converting any [`(AssetId, Balance)`] to [`MultiAsset`] -// TODO: could be replaced by [`Convert<(AssetId, Balance), MultiAsset>`] and/or move to Polkadot repo [`xcm`] module - issue https://github.com/paritytech/polkadot/pull/6760 pub trait MultiAssetConverter: MatchesFungibles where From 17193eb9f3a17361ea136274e47c8c4cddeed03d Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Sun, 26 Feb 2023 23:53:17 +0100 Subject: [PATCH 13/15] Fix check-rust-doc --- parachains/runtimes/assets/statemine/src/xcm_config.rs | 2 +- parachains/runtimes/assets/statemint/src/xcm_config.rs | 2 +- parachains/runtimes/assets/westmint/src/xcm_config.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parachains/runtimes/assets/statemine/src/xcm_config.rs b/parachains/runtimes/assets/statemine/src/xcm_config.rs index 2d2148e5386..8d139f59a7b 100644 --- a/parachains/runtimes/assets/statemine/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemine/src/xcm_config.rs @@ -80,7 +80,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +/// `AssetId/Balancer` converter for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; diff --git a/parachains/runtimes/assets/statemint/src/xcm_config.rs b/parachains/runtimes/assets/statemint/src/xcm_config.rs index 86e3585770b..d7d349d311f 100644 --- a/parachains/runtimes/assets/statemint/src/xcm_config.rs +++ b/parachains/runtimes/assets/statemint/src/xcm_config.rs @@ -80,7 +80,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +/// `AssetId/Balancer` converter for `TrustBackedAssets`` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; diff --git a/parachains/runtimes/assets/westmint/src/xcm_config.rs b/parachains/runtimes/assets/westmint/src/xcm_config.rs index 996ae3d4792..d21389fc40e 100644 --- a/parachains/runtimes/assets/westmint/src/xcm_config.rs +++ b/parachains/runtimes/assets/westmint/src/xcm_config.rs @@ -80,7 +80,7 @@ pub type CurrencyTransactor = CurrencyAdapter< (), >; -/// `AssetId/Balancer` converter for [`TrustBackedAssets`] +/// `AssetId/Balancer` converter for `TrustBackedAssets` pub type TrustBackedAssetsConvertedConcreteId = assets_common::TrustBackedAssetsConvertedConcreteId; From 2ead68ec1979ecb198ec34c6edb29a16ab4148d3 Mon Sep 17 00:00:00 2001 From: Jegor Sidorenko <5252494+jsidorenko@users.noreply.github.com> Date: Thu, 2 Mar 2023 12:36:27 +0200 Subject: [PATCH 14/15] Update parachains/runtimes/assets/common/Cargo.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bastian Köcher --- parachains/runtimes/assets/common/Cargo.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/parachains/runtimes/assets/common/Cargo.toml b/parachains/runtimes/assets/common/Cargo.toml index 6f239c8715b..c551a97757b 100644 --- a/parachains/runtimes/assets/common/Cargo.toml +++ b/parachains/runtimes/assets/common/Cargo.toml @@ -21,8 +21,6 @@ xcm-executor = { git = "https://github.com/paritytech/polkadot", default-feature # Cumulus parachains-common = { path = "../../../common", default-features = false } -#[dev-dependencies] - [build-dependencies] substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } From 572ae0f952272ab15d4e09caf2c8c7687d24ad14 Mon Sep 17 00:00:00 2001 From: parity-processbot <> Date: Thu, 2 Mar 2023 13:58:58 +0000 Subject: [PATCH 15/15] update lockfile for {"substrate", "polkadot"} --- Cargo.lock | 380 ++++++++++++++++++++++++++--------------------------- 1 file changed, 190 insertions(+), 190 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2fb2db5753c..bd2c980e834 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,7 +500,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "hash-db", "log", @@ -3219,7 +3219,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", ] @@ -3242,7 +3242,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-support-procedural", @@ -3267,7 +3267,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "Inflector", "array-bytes 4.2.0", @@ -3314,7 +3314,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3325,7 +3325,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3342,7 +3342,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -3371,7 +3371,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "log", @@ -3387,7 +3387,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "bitflags", "environmental", @@ -3420,7 +3420,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "Inflector", "cfg-expr", @@ -3435,7 +3435,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -3447,7 +3447,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro2", "quote", @@ -3457,7 +3457,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "log", @@ -3475,7 +3475,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -3490,7 +3490,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "sp-api", @@ -3499,7 +3499,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "parity-scale-codec", @@ -5390,7 +5390,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "log", @@ -5409,7 +5409,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "anyhow", "jsonrpsee", @@ -5907,7 +5907,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "frame-benchmarking", @@ -5928,7 +5928,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -5946,7 +5946,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -5961,7 +5961,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -5977,7 +5977,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -5993,7 +5993,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6007,7 +6007,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6031,7 +6031,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6051,7 +6051,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6066,7 +6066,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6085,7 +6085,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "binary-merkle-tree", @@ -6109,7 +6109,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6127,7 +6127,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6171,7 +6171,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6188,7 +6188,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "bitflags", "frame-benchmarking", @@ -6217,7 +6217,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "bitflags", "parity-scale-codec", @@ -6230,7 +6230,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro2", "quote", @@ -6240,7 +6240,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6257,7 +6257,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6275,7 +6275,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6298,7 +6298,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6311,7 +6311,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6329,7 +6329,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6347,7 +6347,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6370,7 +6370,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6386,7 +6386,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6406,7 +6406,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6423,7 +6423,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6437,7 +6437,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6454,7 +6454,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6471,7 +6471,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6487,7 +6487,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6505,7 +6505,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "pallet-nfts", @@ -6516,7 +6516,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6532,7 +6532,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6549,7 +6549,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6569,7 +6569,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -6580,7 +6580,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6597,7 +6597,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6621,7 +6621,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6638,7 +6638,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6653,7 +6653,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6671,7 +6671,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6686,7 +6686,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "assert_matches", "frame-benchmarking", @@ -6705,7 +6705,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6722,7 +6722,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6743,7 +6743,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6759,7 +6759,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6773,7 +6773,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -6796,7 +6796,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6807,7 +6807,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "log", "sp-arithmetic", @@ -6816,7 +6816,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "sp-api", @@ -6825,7 +6825,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6842,7 +6842,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6871,7 +6871,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6889,7 +6889,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6908,7 +6908,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-support", "frame-system", @@ -6924,7 +6924,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6940,7 +6940,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6952,7 +6952,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6969,7 +6969,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -6984,7 +6984,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -7000,7 +7000,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -7015,7 +7015,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-benchmarking", "frame-support", @@ -9964,7 +9964,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "log", "sp-core", @@ -9975,7 +9975,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -10002,7 +10002,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "futures-timer", @@ -10025,7 +10025,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -10040,7 +10040,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -10059,7 +10059,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -10070,7 +10070,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "chrono", @@ -10110,7 +10110,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "fnv", "futures", @@ -10136,7 +10136,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "hash-db", "kvdb", @@ -10162,7 +10162,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -10187,7 +10187,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -10216,7 +10216,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "fork-tree", @@ -10255,7 +10255,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "jsonrpsee", @@ -10277,7 +10277,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10311,7 +10311,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "jsonrpsee", @@ -10330,7 +10330,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "fork-tree", "parity-scale-codec", @@ -10343,7 +10343,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ahash 0.8.2", "array-bytes 4.2.0", @@ -10383,7 +10383,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "finality-grandpa", "futures", @@ -10403,7 +10403,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -10426,7 +10426,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "lru 0.8.1", "parity-scale-codec", @@ -10450,7 +10450,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -10463,7 +10463,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "log", "sc-allocator", @@ -10476,7 +10476,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "anyhow", "cfg-if", @@ -10494,7 +10494,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ansi_term", "futures", @@ -10509,7 +10509,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10524,7 +10524,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "async-channel", @@ -10567,7 +10567,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "cid", "futures", @@ -10586,7 +10586,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "bitflags", @@ -10612,7 +10612,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ahash 0.8.2", "futures", @@ -10630,7 +10630,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10651,7 +10651,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -10683,7 +10683,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10702,7 +10702,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "bytes", @@ -10732,7 +10732,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "libp2p", @@ -10745,7 +10745,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -10754,7 +10754,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "jsonrpsee", @@ -10784,7 +10784,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10803,7 +10803,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "http", "jsonrpsee", @@ -10818,7 +10818,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "futures", @@ -10844,7 +10844,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "directories", @@ -10910,7 +10910,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "log", "parity-scale-codec", @@ -10921,7 +10921,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "clap 4.1.6", "fs4", @@ -10937,7 +10937,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -10956,7 +10956,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "libc", @@ -10975,7 +10975,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "chrono", "futures", @@ -10994,7 +10994,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ansi_term", "atty", @@ -11025,7 +11025,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11036,7 +11036,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -11063,7 +11063,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -11077,7 +11077,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "backtrace", "futures", @@ -11604,7 +11604,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "hash-db", "log", @@ -11622,7 +11622,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "blake2", "proc-macro-crate", @@ -11634,7 +11634,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -11647,7 +11647,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "integer-sqrt", "num-traits", @@ -11661,7 +11661,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -11674,7 +11674,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "sp-api", @@ -11686,7 +11686,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "log", @@ -11704,7 +11704,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -11719,7 +11719,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "parity-scale-codec", @@ -11737,7 +11737,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "merlin", @@ -11760,7 +11760,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "lazy_static", "parity-scale-codec", @@ -11779,7 +11779,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "finality-grandpa", "log", @@ -11797,7 +11797,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -11809,7 +11809,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -11822,7 +11822,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "base58", @@ -11865,7 +11865,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "blake2", "byteorder", @@ -11879,7 +11879,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro2", "quote", @@ -11890,7 +11890,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -11899,7 +11899,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro2", "quote", @@ -11909,7 +11909,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "environmental", "parity-scale-codec", @@ -11920,7 +11920,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -11935,7 +11935,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "bytes", "ed25519", @@ -11960,7 +11960,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "lazy_static", "sp-core", @@ -11971,7 +11971,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures", @@ -11988,7 +11988,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "thiserror", "zstd", @@ -11997,7 +11997,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -12015,7 +12015,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -12029,7 +12029,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "sp-api", "sp-core", @@ -12039,7 +12039,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "backtrace", "lazy_static", @@ -12049,7 +12049,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "rustc-hash", "serde", @@ -12059,7 +12059,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "either", "hash256-std-hasher", @@ -12081,7 +12081,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -12099,7 +12099,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "Inflector", "proc-macro-crate", @@ -12111,7 +12111,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "serde", "serde_json", @@ -12120,7 +12120,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -12134,7 +12134,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -12146,7 +12146,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "hash-db", "log", @@ -12166,12 +12166,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12184,7 +12184,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "futures-timer", @@ -12199,7 +12199,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "sp-std", @@ -12211,7 +12211,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "sp-api", "sp-runtime", @@ -12220,7 +12220,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "log", @@ -12236,7 +12236,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ahash 0.8.2", "hash-db", @@ -12259,7 +12259,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "impl-serde", "parity-scale-codec", @@ -12276,7 +12276,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -12287,7 +12287,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -12301,7 +12301,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "parity-scale-codec", "scale-info", @@ -12611,7 +12611,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "platforms", ] @@ -12619,7 +12619,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -12638,7 +12638,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "hyper", "log", @@ -12650,7 +12650,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "jsonrpsee", @@ -12663,7 +12663,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "jsonrpsee", "log", @@ -12682,7 +12682,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "array-bytes 4.2.0", "async-trait", @@ -12708,7 +12708,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "futures", "substrate-test-utils-derive", @@ -12718,7 +12718,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12729,7 +12729,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "ansi_term", "build-helper", @@ -13378,7 +13378,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4aa213ce1aef94f97836e7ceec753e2a131c849a" +source = "git+https://github.com/paritytech/substrate?branch=master#d1d67cddf577ef275a2ca339312805c6d25ef9e5" dependencies = [ "async-trait", "clap 4.1.6",