From e68d4c552e9018ca6a894cf7440cc431b35c9e49 Mon Sep 17 00:00:00 2001 From: R0GUE Date: Mon, 22 Apr 2024 21:25:16 +0200 Subject: [PATCH] style: trust backed assets naming --- runtime/devnet/src/assets_config.rs | 16 +++++----- runtime/devnet/src/lib.rs | 2 +- runtime/devnet/src/proxy_config.rs | 44 +++++++++++++++------------- runtime/testnet/src/assets_config.rs | 16 +++++----- runtime/testnet/src/lib.rs | 2 +- runtime/testnet/src/proxy_config.rs | 44 +++++++++++++++------------- 6 files changed, 64 insertions(+), 60 deletions(-) diff --git a/runtime/devnet/src/assets_config.rs b/runtime/devnet/src/assets_config.rs index 34035c1f..c682a68e 100644 --- a/runtime/devnet/src/assets_config.rs +++ b/runtime/devnet/src/assets_config.rs @@ -1,6 +1,6 @@ use crate::{ - deposit, AccountId, Assets, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent, - RuntimeHoldReason, DAYS, EXISTENTIAL_DEPOSIT, UNIT, + deposit, AccountId, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent, + RuntimeHoldReason, TrustBackedAssets, DAYS, EXISTENTIAL_DEPOSIT, UNIT, }; use frame_support::{ parameter_types, @@ -84,9 +84,9 @@ impl pallet_nft_fractionalization::Config for Runtime { type StringLimit = AssetsStringLimit; type NftCollectionId = ::CollectionId; type NftId = ::ItemId; - type AssetBalance = >::Balance; - type AssetId = >::AssetId; - type Assets = Assets; + type AssetBalance = >::Balance; + type AssetId = >::AssetId; + type Assets = TrustBackedAssets; type Nfts = Nfts; type PalletId = NftFractionalizationPalletId; type WeightInfo = pallet_nft_fractionalization::weights::SubstrateWeight; @@ -95,9 +95,9 @@ impl pallet_nft_fractionalization::Config for Runtime { type BenchmarkHelper = (); } -pub type TrustBackedAssets = pallet_assets::Instance1; -pub type TrustBackedAssetsCall = pallet_assets::Call; -impl pallet_assets::Config for Runtime { +pub type TrustBackedAssetsInstance = pallet_assets::Instance1; +pub type TrustBackedAssetsCall = pallet_assets::Call; +impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetIdForTrustBackedAssets; diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 95af3a5f..06ca6fcb 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -633,7 +633,7 @@ construct_runtime!( // Assets Nfts: pallet_nfts = 50, NftFractionalization: pallet_nft_fractionalization = 51, - Assets: pallet_assets:: = 52, + TrustBackedAssets: pallet_assets:: = 52, } ); diff --git a/runtime/devnet/src/proxy_config.rs b/runtime/devnet/src/proxy_config.rs index fad05383..c72b75b9 100644 --- a/runtime/devnet/src/proxy_config.rs +++ b/runtime/devnet/src/proxy_config.rs @@ -14,7 +14,7 @@ impl InstanceFilter for ProxyType { ProxyType::NonTransfer => !matches!( c, RuntimeCall::Balances { .. } - | RuntimeCall::Assets { .. } + | RuntimeCall::TrustBackedAssets { .. } | RuntimeCall::Nfts { .. } ), ProxyType::CancelProxy => matches!( @@ -26,7 +26,7 @@ impl InstanceFilter for ProxyType { ProxyType::Assets => { matches!( c, - RuntimeCall::Assets { .. } + RuntimeCall::TrustBackedAssets { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | RuntimeCall::Nfts { .. } @@ -34,16 +34,18 @@ impl InstanceFilter for ProxyType { }, ProxyType::AssetOwner => matches!( c, - RuntimeCall::Assets(TrustBackedAssetsCall::create { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::start_destroy { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::destroy_accounts { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::destroy_approvals { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::finish_destroy { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::transfer_ownership { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_team { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_metadata { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::clear_metadata { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_min_balance { .. }) + RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::create { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::start_destroy { .. }) + | RuntimeCall::TrustBackedAssets( + TrustBackedAssetsCall::destroy_accounts { .. } + ) | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::destroy_approvals { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::finish_destroy { .. }) + | RuntimeCall::TrustBackedAssets( + TrustBackedAssetsCall::transfer_ownership { .. } + ) | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_team { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_metadata { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::clear_metadata { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_min_balance { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::create { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::destroy { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::redeposit { .. }) @@ -56,15 +58,15 @@ impl InstanceFilter for ProxyType { ), ProxyType::AssetManager => matches!( c, - RuntimeCall::Assets(TrustBackedAssetsCall::mint { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::burn { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::freeze { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::block { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::thaw { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::freeze_asset { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::thaw_asset { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::touch_other { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::refund_other { .. }) + RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::mint { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::burn { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::freeze { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::block { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::thaw { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::freeze_asset { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::thaw_asset { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::touch_other { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::refund_other { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::force_mint { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::update_mint_settings { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::mint_pre_signed { .. }) diff --git a/runtime/testnet/src/assets_config.rs b/runtime/testnet/src/assets_config.rs index 34035c1f..c682a68e 100644 --- a/runtime/testnet/src/assets_config.rs +++ b/runtime/testnet/src/assets_config.rs @@ -1,6 +1,6 @@ use crate::{ - deposit, AccountId, Assets, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent, - RuntimeHoldReason, DAYS, EXISTENTIAL_DEPOSIT, UNIT, + deposit, AccountId, Balance, Balances, BlockNumber, Nfts, Runtime, RuntimeEvent, + RuntimeHoldReason, TrustBackedAssets, DAYS, EXISTENTIAL_DEPOSIT, UNIT, }; use frame_support::{ parameter_types, @@ -84,9 +84,9 @@ impl pallet_nft_fractionalization::Config for Runtime { type StringLimit = AssetsStringLimit; type NftCollectionId = ::CollectionId; type NftId = ::ItemId; - type AssetBalance = >::Balance; - type AssetId = >::AssetId; - type Assets = Assets; + type AssetBalance = >::Balance; + type AssetId = >::AssetId; + type Assets = TrustBackedAssets; type Nfts = Nfts; type PalletId = NftFractionalizationPalletId; type WeightInfo = pallet_nft_fractionalization::weights::SubstrateWeight; @@ -95,9 +95,9 @@ impl pallet_nft_fractionalization::Config for Runtime { type BenchmarkHelper = (); } -pub type TrustBackedAssets = pallet_assets::Instance1; -pub type TrustBackedAssetsCall = pallet_assets::Call; -impl pallet_assets::Config for Runtime { +pub type TrustBackedAssetsInstance = pallet_assets::Instance1; +pub type TrustBackedAssetsCall = pallet_assets::Call; +impl pallet_assets::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Balance = Balance; type AssetId = AssetIdForTrustBackedAssets; diff --git a/runtime/testnet/src/lib.rs b/runtime/testnet/src/lib.rs index 95af3a5f..06ca6fcb 100644 --- a/runtime/testnet/src/lib.rs +++ b/runtime/testnet/src/lib.rs @@ -633,7 +633,7 @@ construct_runtime!( // Assets Nfts: pallet_nfts = 50, NftFractionalization: pallet_nft_fractionalization = 51, - Assets: pallet_assets:: = 52, + TrustBackedAssets: pallet_assets:: = 52, } ); diff --git a/runtime/testnet/src/proxy_config.rs b/runtime/testnet/src/proxy_config.rs index fad05383..c72b75b9 100644 --- a/runtime/testnet/src/proxy_config.rs +++ b/runtime/testnet/src/proxy_config.rs @@ -14,7 +14,7 @@ impl InstanceFilter for ProxyType { ProxyType::NonTransfer => !matches!( c, RuntimeCall::Balances { .. } - | RuntimeCall::Assets { .. } + | RuntimeCall::TrustBackedAssets { .. } | RuntimeCall::Nfts { .. } ), ProxyType::CancelProxy => matches!( @@ -26,7 +26,7 @@ impl InstanceFilter for ProxyType { ProxyType::Assets => { matches!( c, - RuntimeCall::Assets { .. } + RuntimeCall::TrustBackedAssets { .. } | RuntimeCall::Utility { .. } | RuntimeCall::Multisig { .. } | RuntimeCall::Nfts { .. } @@ -34,16 +34,18 @@ impl InstanceFilter for ProxyType { }, ProxyType::AssetOwner => matches!( c, - RuntimeCall::Assets(TrustBackedAssetsCall::create { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::start_destroy { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::destroy_accounts { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::destroy_approvals { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::finish_destroy { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::transfer_ownership { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_team { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_metadata { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::clear_metadata { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::set_min_balance { .. }) + RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::create { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::start_destroy { .. }) + | RuntimeCall::TrustBackedAssets( + TrustBackedAssetsCall::destroy_accounts { .. } + ) | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::destroy_approvals { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::finish_destroy { .. }) + | RuntimeCall::TrustBackedAssets( + TrustBackedAssetsCall::transfer_ownership { .. } + ) | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_team { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_metadata { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::clear_metadata { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_min_balance { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::create { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::destroy { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::redeposit { .. }) @@ -56,15 +58,15 @@ impl InstanceFilter for ProxyType { ), ProxyType::AssetManager => matches!( c, - RuntimeCall::Assets(TrustBackedAssetsCall::mint { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::burn { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::freeze { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::block { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::thaw { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::freeze_asset { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::thaw_asset { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::touch_other { .. }) - | RuntimeCall::Assets(TrustBackedAssetsCall::refund_other { .. }) + RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::mint { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::burn { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::freeze { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::block { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::thaw { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::freeze_asset { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::thaw_asset { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::touch_other { .. }) + | RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::refund_other { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::force_mint { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::update_mint_settings { .. }) | RuntimeCall::Nfts(pallet_nfts::Call::mint_pre_signed { .. })