Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(runtime): adjust proxy filters #4342

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading