Skip to content

Commit

Permalink
refactor(runtime): adjust proxy filters (#4342)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Nov 17, 2024
1 parent 27c1478 commit 9d480ca
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions runtime/vara/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1036,21 +1036,26 @@ impl InstanceFilter<RuntimeCall> 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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 9d480ca

Please sign in to comment.