-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Frank Bell <[email protected]>
- Loading branch information
1 parent
efbb2ae
commit 5264ace
Showing
11 changed files
with
308 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
use crate::{assets_config::TrustBackedAssetsCall, Balances, Runtime, RuntimeCall, RuntimeEvent}; | ||
use sp_runtime::traits::BlakeTwo256; | ||
|
||
use frame_support::traits::InstanceFilter; | ||
use pop_runtime_common::proxy::{ | ||
AnnouncementDepositBase, AnnouncementDepositFactor, MaxPending, MaxProxies, ProxyDepositBase, | ||
ProxyDepositFactor, ProxyType, | ||
}; | ||
|
||
impl InstanceFilter<RuntimeCall> for ProxyType { | ||
fn filter(&self, c: &RuntimeCall) -> bool { | ||
match self { | ||
ProxyType::Any => true, | ||
ProxyType::NonTransfer => !matches!( | ||
c, | ||
RuntimeCall::Balances { .. } | ||
| RuntimeCall::Assets { .. } | ||
| RuntimeCall::Nfts { .. } | ||
), | ||
ProxyType::CancelProxy => matches!( | ||
c, | ||
RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) | ||
| RuntimeCall::Utility { .. } | ||
| RuntimeCall::Multisig { .. } | ||
), | ||
ProxyType::Assets => { | ||
matches!( | ||
c, | ||
RuntimeCall::Assets { .. } | ||
| RuntimeCall::Utility { .. } | ||
| RuntimeCall::Multisig { .. } | ||
| RuntimeCall::Nfts { .. } | ||
) | ||
}, | ||
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::Nfts(pallet_nfts::Call::create { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::destroy { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::redeposit { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::transfer_ownership { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::set_team { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::set_collection_max_supply { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::lock_collection { .. }) | ||
| RuntimeCall::Utility { .. } | ||
| RuntimeCall::Multisig { .. } | ||
), | ||
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::Nfts(pallet_nfts::Call::force_mint { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::update_mint_settings { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::mint_pre_signed { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::set_attributes_pre_signed { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::lock_item_transfer { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::unlock_item_transfer { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::lock_item_properties { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::set_metadata { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::clear_metadata { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::set_collection_metadata { .. }) | ||
| RuntimeCall::Nfts(pallet_nfts::Call::clear_collection_metadata { .. }) | ||
| RuntimeCall::Utility { .. } | ||
| RuntimeCall::Multisig { .. } | ||
), | ||
ProxyType::Collator => matches!( | ||
c, | ||
RuntimeCall::CollatorSelection { .. } | ||
| RuntimeCall::Utility { .. } | ||
| RuntimeCall::Multisig { .. } | ||
), | ||
} | ||
} | ||
|
||
fn is_superset(&self, o: &Self) -> bool { | ||
ProxyType::is_superset(self, o) | ||
} | ||
} | ||
|
||
impl pallet_proxy::Config for Runtime { | ||
type RuntimeEvent = RuntimeEvent; | ||
type RuntimeCall = RuntimeCall; | ||
type Currency = Balances; | ||
type ProxyType = ProxyType; | ||
type ProxyDepositBase = ProxyDepositBase; | ||
type ProxyDepositFactor = ProxyDepositFactor; | ||
type MaxProxies = MaxProxies; | ||
type WeightInfo = pallet_proxy::weights::SubstrateWeight<Self>; | ||
type MaxPending = MaxPending; | ||
type CallHasher = BlakeTwo256; | ||
type AnnouncementDepositBase = AnnouncementDepositBase; | ||
type AnnouncementDepositFactor = AnnouncementDepositFactor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.