Skip to content
Snippets Groups Projects
Commit ab175265 authored by Éloïs's avatar Éloïs
Browse files

feat(runtimes): add call filter: forbid Session & Membership calls

parent 65c3d10a
No related branches found
No related tags found
No related merge requests found
......@@ -27,7 +27,7 @@ macro_rules! pallets_config {
impl frame_system::Config for Runtime {
/// The basic call filter to use in dispatchable.
type BaseCallFilter = frame_support::traits::Everything;
type BaseCallFilter = BaseCallFilter;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = BlockWeights;
/// The maximum length of a block (in bytes).
......
......@@ -140,6 +140,17 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
pub struct BaseCallFilter;
impl frame_support::traits::Contains<Call> for BaseCallFilter {
fn contains(call: &Call) -> bool {
match call {
Call::Membership(_) => false,
Call::Session(_) => false,
_ => true,
}
}
}
common_runtime_except_gdev::pallets_config! {
impl pallet_sudo::Config for Runtime {
type Event = Event;
......
......@@ -132,6 +132,16 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
pub struct BaseCallFilter;
impl frame_support::traits::Contains<Call> for BaseCallFilter {
fn contains(call: &Call) -> bool {
match call {
Call::Membership(_) => false,
_ => true,
}
}
}
// Configure FRAME pallets to include in runtime.
common_runtime::pallets_config! {
impl pallet_sudo::Config for Runtime {
......
......@@ -140,6 +140,17 @@ pub type Executive = frame_executive::Executive<
AllPalletsWithSystem,
>;
pub struct BaseCallFilter;
impl frame_support::traits::Contains<Call> for BaseCallFilter {
fn contains(call: &Call) -> bool {
match call {
Call::Membership(_) => false,
Call::Session(_) => false,
_ => true,
}
}
}
common_runtime_except_gdev::pallets_config! {
impl pallet_sudo::Config for Runtime {
type Event = Event;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment