Skip to content

Commit

Permalink
Filter call
Browse files Browse the repository at this point in the history
Signed-off-by: Xavier Lau <x@acg.box>
  • Loading branch information
aurexav committed Oct 9, 2024
1 parent c2cc1d9 commit 36423d4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion runtime/darwinia/src/pallets/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,22 @@ frame_support::parameter_types! {
pub const Version: sp_version::RuntimeVersion = VERSION;
}

pub enum LockAndStake {}
impl frame_support::traits::Contains<RuntimeCall> for LockAndStake {
fn contains(c: &RuntimeCall) -> bool {
matches!(
c,
RuntimeCall::DarwiniaStaking(darwinia_staking::Call::stake { .. })
| RuntimeCall::Deposit(darwinia_deposit::Call::lock { .. })
)
}
}

#[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type AccountData = pallet_balances::AccountData<Balance>;
type AccountId = AccountId;
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = frame_support::traits::EverythingBut<LockAndStake>;
type Block = Block;
type BlockLength = pallet_config::RuntimeBlockLength;
type BlockWeights = pallet_config::RuntimeBlockWeights;
Expand Down

0 comments on commit 36423d4

Please sign in to comment.