diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 90fd884..d7b7900 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -18,7 +18,7 @@ use frame_support::{ genesis_builder_helper::{build_config, create_default_config}, parameter_types, traits::{ - AsEnsureOriginWithArg, ConstU32, ConstU64, EitherOfDiverse, Everything, InstanceFilter, + AsEnsureOriginWithArg, ConstU32, ConstU64, Contains, EitherOfDiverse, InstanceFilter, TransformOrigin, }, weights::{ @@ -279,6 +279,21 @@ parameter_types! { pub const SS58Prefix: u16 = 42; } +pub struct NormalFilter; +impl Contains for NormalFilter { + fn contains(c: &RuntimeCall) -> bool { + match c { + // We filter anonymous proxy as they make "reserve" inconsistent + // See: https://github.com/paritytech/substrate/blob/37cca710eed3dadd4ed5364c7686608f5175cce1/frame/proxy/src/lib.rs#L270 + RuntimeCall::Proxy(method) => !matches!( + method, + pallet_proxy::Call::create_pure { .. } | pallet_proxy::Call::kill_pure { .. } + ), + _ => true, + } + } +} + // Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { /// The data to be stored in an account. @@ -286,7 +301,7 @@ impl frame_system::Config for Runtime { /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The basic call filter to use in dispatchable. - type BaseCallFilter = Everything; + type BaseCallFilter = NormalFilter; /// The block type. type Block = Block; /// Maximum number of block number to block hash mappings to keep (oldest