From 799558035320e44e8a73829d718242226addd54a Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Fri, 29 Sep 2023 08:54:57 +0100 Subject: [PATCH 1/4] use traits::tokens::fungible => traits::fungible --- .../runtimes/assets/test-utils/src/test_cases.rs | 2 +- cumulus/parachains/runtimes/test-utils/src/lib.rs | 8 ++++---- polkadot/xcm/xcm-builder/src/asset_conversion.rs | 2 +- polkadot/xcm/xcm-builder/src/fungibles_adapter.rs | 2 +- polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs | 2 +- substrate/frame/assets/src/tests.rs | 8 ++++---- substrate/frame/balances/src/tests/mod.rs | 2 +- substrate/frame/examples/kitchensink/src/lib.rs | 2 +- .../frame/support/src/traits/tokens/fungible/item_of.rs | 2 +- .../asset-conversion-tx-payment/src/lib.rs | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs index 7a8d571403c6b..f1e4f1e5ef5f5 100644 --- a/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs +++ b/cumulus/parachains/runtimes/assets/test-utils/src/test_cases.rs @@ -1190,7 +1190,7 @@ pub fn create_and_manage_foreign_assets_for_local_consensus_parachain_assets_wor .is_empty()); // check update metadata - use frame_support::traits::tokens::fungibles::roles::Inspect as InspectRoles; + use frame_support::traits::fungibles::roles::Inspect as InspectRoles; assert_eq!( >::owner( asset_id.into() diff --git a/cumulus/parachains/runtimes/test-utils/src/lib.rs b/cumulus/parachains/runtimes/test-utils/src/lib.rs index 8289a80baa11a..3241ac179d278 100644 --- a/cumulus/parachains/runtimes/test-utils/src/lib.rs +++ b/cumulus/parachains/runtimes/test-utils/src/lib.rs @@ -415,8 +415,8 @@ pub fn assert_metadata( expected_symbol: &str, expected_decimals: u8, ) where - Fungibles: frame_support::traits::tokens::fungibles::metadata::Inspect - + frame_support::traits::tokens::fungibles::Inspect, + Fungibles: frame_support::traits::fungibles::metadata::Inspect + + frame_support::traits::fungibles::Inspect, { assert_eq!(Fungibles::name(asset_id.into()), Vec::from(expected_name),); assert_eq!(Fungibles::symbol(asset_id.into()), Vec::from(expected_symbol),); @@ -428,8 +428,8 @@ pub fn assert_total( expected_total_issuance: impl Into, expected_active_issuance: impl Into, ) where - Fungibles: frame_support::traits::tokens::fungibles::metadata::Inspect - + frame_support::traits::tokens::fungibles::Inspect, + Fungibles: frame_support::traits::fungibles::metadata::Inspect + + frame_support::traits::fungibles::Inspect, { assert_eq!(Fungibles::total_issuance(asset_id.into()), expected_total_issuance.into()); assert_eq!(Fungibles::active_issuance(asset_id.into()), expected_active_issuance.into()); diff --git a/polkadot/xcm/xcm-builder/src/asset_conversion.rs b/polkadot/xcm/xcm-builder/src/asset_conversion.rs index a246436a9d6d3..1684e3d296a1d 100644 --- a/polkadot/xcm/xcm-builder/src/asset_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/asset_conversion.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. +//! Adapters to work with `frame_support::traits::fungibles` through XCM. use frame_support::traits::{Contains, Get}; use sp_runtime::traits::MaybeEquivalence; diff --git a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs index d7fded01e2db7..6912d9083b672 100644 --- a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. +//! Adapters to work with `frame_support::traits::fungibles` through XCM. use frame_support::traits::{ tokens::{ diff --git a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs index 6cf5980df0e9e..4f8ed1353110f 100644 --- a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::tokens::fungibles` through XCM. +//! Adapters to work with `frame_support::traits::fungibles` through XCM. use crate::{AssetChecking, MintLocation}; use frame_support::{ diff --git a/substrate/frame/assets/src/tests.rs b/substrate/frame/assets/src/tests.rs index 06d4ec1211737..f1b116a0f4a0d 100644 --- a/substrate/frame/assets/src/tests.rs +++ b/substrate/frame/assets/src/tests.rs @@ -1328,7 +1328,7 @@ fn freezer_should_work() { #[test] fn imbalances_should_work() { - use frame_support::traits::tokens::fungibles::Balanced; + use frame_support::traits::fungibles::Balanced; new_test_ext().execute_with(|| { assert_ok!(Assets::force_create(RuntimeOrigin::root(), 0, 1, true, 1)); @@ -1591,7 +1591,7 @@ fn assets_from_genesis_should_exist() { #[test] fn querying_name_symbol_and_decimals_should_work() { new_test_ext().execute_with(|| { - use frame_support::traits::tokens::fungibles::metadata::Inspect; + use frame_support::traits::fungibles::metadata::Inspect; assert_ok!(Assets::force_create(RuntimeOrigin::root(), 0, 1, true, 1)); assert_ok!(Assets::force_set_metadata( RuntimeOrigin::root(), @@ -1610,7 +1610,7 @@ fn querying_name_symbol_and_decimals_should_work() { #[test] fn querying_allowance_should_work() { new_test_ext().execute_with(|| { - use frame_support::traits::tokens::fungibles::approvals::{Inspect, Mutate}; + use frame_support::traits::fungibles::approvals::{Inspect, Mutate}; assert_ok!(Assets::force_create(RuntimeOrigin::root(), 0, 1, true, 1)); assert_ok!(Assets::mint(RuntimeOrigin::signed(1), 0, 1, 100)); Balances::make_free_balance_be(&1, 2); @@ -1635,7 +1635,7 @@ fn transfer_large_asset() { #[test] fn querying_roles_should_work() { new_test_ext().execute_with(|| { - use frame_support::traits::tokens::fungibles::roles::Inspect; + use frame_support::traits::fungibles::roles::Inspect; assert_ok!(Assets::force_create(RuntimeOrigin::root(), 0, 1, true, 1)); assert_ok!(Assets::set_team( RuntimeOrigin::signed(1), diff --git a/substrate/frame/balances/src/tests/mod.rs b/substrate/frame/balances/src/tests/mod.rs index d15f8e89118cc..a0a3085c54f90 100644 --- a/substrate/frame/balances/src/tests/mod.rs +++ b/substrate/frame/balances/src/tests/mod.rs @@ -26,7 +26,7 @@ use frame_support::{ dispatch::{DispatchInfo, GetDispatchInfo}, parameter_types, traits::{ - tokens::fungible, ConstU32, ConstU64, ConstU8, Imbalance as ImbalanceT, OnUnbalanced, + fungible, ConstU32, ConstU64, ConstU8, Imbalance as ImbalanceT, OnUnbalanced, StorageMapShim, StoredMap, WhitelistedStorageKeys, }, weights::{IdentityFee, Weight}, diff --git a/substrate/frame/examples/kitchensink/src/lib.rs b/substrate/frame/examples/kitchensink/src/lib.rs index 0fbffc971da62..56117c59dc6d7 100644 --- a/substrate/frame/examples/kitchensink/src/lib.rs +++ b/substrate/frame/examples/kitchensink/src/lib.rs @@ -74,7 +74,7 @@ pub mod pallet { type WeightInfo: WeightInfo; /// This is a normal Rust type, nothing specific to FRAME here. - type Currency: frame_support::traits::tokens::fungible::Inspect; + type Currency: frame_support::traits::fungible::Inspect; /// Similarly, let the runtime decide this. fn some_function() -> u32; diff --git a/substrate/frame/support/src/traits/tokens/fungible/item_of.rs b/substrate/frame/support/src/traits/tokens/fungible/item_of.rs index 88b9de7fdbf64..a47998eb134e9 100644 --- a/substrate/frame/support/src/traits/tokens/fungible/item_of.rs +++ b/substrate/frame/support/src/traits/tokens/fungible/item_of.rs @@ -354,7 +354,7 @@ impl< Balance, AssetIdType, AssetId: Get, - Handler: crate::traits::tokens::fungibles::HandleImbalanceDrop, + Handler: crate::traits::fungibles::HandleImbalanceDrop, > HandleImbalanceDrop for ConvertImbalanceDropHandler { diff --git a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/lib.rs b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/lib.rs index c2d9ed56c7aa3..04a71e2ff4260 100644 --- a/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/lib.rs +++ b/substrate/frame/transaction-payment/asset-conversion-tx-payment/src/lib.rs @@ -48,7 +48,7 @@ use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchInfo, DispatchResult, PostDispatchInfo}, traits::{ - tokens::fungibles::{Balanced, Inspect}, + fungibles::{Balanced, Inspect}, IsType, }, DefaultNoBound, From 742e7683b00930512d388c9ed4feabc0655370ac Mon Sep 17 00:00:00 2001 From: Squirrel Date: Fri, 29 Sep 2023 17:16:13 +0100 Subject: [PATCH 2/4] Update polkadot/xcm/xcm-builder/src/asset_conversion.rs Co-authored-by: Liam Aharon --- polkadot/xcm/xcm-builder/src/asset_conversion.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot/xcm/xcm-builder/src/asset_conversion.rs b/polkadot/xcm/xcm-builder/src/asset_conversion.rs index 1684e3d296a1d..5b76ed764a812 100644 --- a/polkadot/xcm/xcm-builder/src/asset_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/asset_conversion.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::fungibles` through XCM. +//! Adapters to work with [`frame_support::traits::fungibles`] through XCM. use frame_support::traits::{Contains, Get}; use sp_runtime::traits::MaybeEquivalence; From 5f74fe407ea229d94520f8b7aca11964c2a7fa4d Mon Sep 17 00:00:00 2001 From: Squirrel Date: Fri, 29 Sep 2023 17:16:19 +0100 Subject: [PATCH 3/4] Update polkadot/xcm/xcm-builder/src/fungibles_adapter.rs Co-authored-by: Liam Aharon --- polkadot/xcm/xcm-builder/src/fungibles_adapter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs index 6912d9083b672..2179421b3ebc9 100644 --- a/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/fungibles_adapter.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::fungibles` through XCM. +//! Adapters to work with [`frame_support::traits::fungibles`] through XCM. use frame_support::traits::{ tokens::{ From 34454ba6a2ccf5a19a56b422b8f7890f02fdd565 Mon Sep 17 00:00:00 2001 From: Squirrel Date: Fri, 29 Sep 2023 17:16:27 +0100 Subject: [PATCH 4/4] Update polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs Co-authored-by: Liam Aharon --- polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs index 4f8ed1353110f..4aebb496d497c 100644 --- a/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs +++ b/polkadot/xcm/xcm-builder/src/nonfungibles_adapter.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -//! Adapters to work with `frame_support::traits::fungibles` through XCM. +//! Adapters to work with [`frame_support::traits::fungibles`] through XCM. use crate::{AssetChecking, MintLocation}; use frame_support::{