From 9d480cab5b2d4fdaf091e65eb9e365d6e3b0e074 Mon Sep 17 00:00:00 2001 From: Dmitrii Novikov Date: Sun, 17 Nov 2024 15:37:06 +0400 Subject: [PATCH] refactor(runtime): adjust proxy filters (#4342) --- runtime/vara/src/lib.rs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/runtime/vara/src/lib.rs b/runtime/vara/src/lib.rs index e810bccbcac..0b1885dd16c 100644 --- a/runtime/vara/src/lib.rs +++ b/runtime/vara/src/lib.rs @@ -1036,21 +1036,26 @@ impl InstanceFilter for ProxyType { match self { ProxyType::Any => true, ProxyType::NonTransfer => { + // Dev pallets. #[cfg(feature = "dev")] - return !matches!( + if matches!( c, - RuntimeCall::Balances(..) + RuntimeCall::GearDebug(..) + | RuntimeCall::GearEthBridge(..) | RuntimeCall::Sudo(..) - | RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) - | RuntimeCall::Vesting(pallet_vesting::Call::force_vested_transfer { .. }) - ); - #[cfg(not(feature = "dev"))] - return !matches!( + ) { + return false; + } + + !matches!( c, - RuntimeCall::Balances(..) - | RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) - | RuntimeCall::Vesting(pallet_vesting::Call::force_vested_transfer { .. }) - ); + // Classic pallets. + RuntimeCall::Balances(..) | RuntimeCall::Vesting(..) + // Gear pallets. + | RuntimeCall::Gear(..) + | RuntimeCall::GearVoucher(..) + | RuntimeCall::StakingRewards(..) + ) } ProxyType::Governance => matches!( c, @@ -1428,6 +1433,7 @@ mod runtime { pub type NominationPools = pallet_nomination_pools; // Gear + // NOTE (!): if adding new pallet, don't forget to extend non payable proxy filter. #[runtime::pallet_index(100)] pub type GearProgram = pallet_gear_program;