diff --git a/runtime/local/src/lib.rs b/runtime/local/src/lib.rs index 40c1e7e9a..09de1830e 100644 --- a/runtime/local/src/lib.rs +++ b/runtime/local/src/lib.rs @@ -27,8 +27,8 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use frame_support::{ construct_runtime, parameter_types, traits::{ - AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Currency, EitherOfDiverse, - EqualPrivilegeOnly, FindAuthor, Get, InstanceFilter, Nothing, OnFinalize, WithdrawReasons, + AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Contains, Currency, EitherOfDiverse, + EqualPrivilegeOnly, FindAuthor, Get, InstanceFilter, OnFinalize, WithdrawReasons, }, weights::{ constants::{RocksDbWeight, WEIGHT_REF_TIME_PER_SECOND}, @@ -799,6 +799,17 @@ impl pallet_vesting::Config for Runtime { const MAX_VESTING_SCHEDULES: u32 = 28; } +pub struct CallRuntimeFilter; +impl Contains for CallRuntimeFilter { + fn contains(c: &RuntimeCall) -> bool { + match *c { + RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true, + RuntimeCall::Assets(pallet_assets::Call::transfer_approved { .. }) => true, + _ => false, + } + } +} + parameter_types! { pub const DepositPerItem: Balance = deposit(1, 0); pub const DepositPerByte: Balance = deposit(0, 1); @@ -819,7 +830,7 @@ impl pallet_contracts::Config for Runtime { /// and make sure they are stable. Dispatchables exposed to contracts are not allowed to /// change because that would break already deployed contracts. The `Call` structure itself /// is not allowed to change the indices of existing pallets, too. - type CallFilter = Nothing; + type CallFilter = CallRuntimeFilter; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; type DefaultDepositLimit = DefaultDepositLimit; diff --git a/runtime/shibuya/src/lib.rs b/runtime/shibuya/src/lib.rs index 5da4ebbc5..a7fa65403 100644 --- a/runtime/shibuya/src/lib.rs +++ b/runtime/shibuya/src/lib.rs @@ -29,8 +29,7 @@ use frame_support::{ parameter_types, traits::{ AsEnsureOriginWithArg, ConstU32, Contains, Currency, EitherOfDiverse, EqualPrivilegeOnly, - FindAuthor, Get, Imbalance, InstanceFilter, Nothing, OnFinalize, OnUnbalanced, - WithdrawReasons, + FindAuthor, Get, Imbalance, InstanceFilter, OnFinalize, OnUnbalanced, WithdrawReasons, }, weights::{ constants::{ @@ -656,6 +655,17 @@ impl pallet_vesting::Config for Runtime { const MAX_VESTING_SCHEDULES: u32 = 28; } +pub struct CallRuntimeFilter; +impl Contains for CallRuntimeFilter { + fn contains(c: &RuntimeCall) -> bool { + match *c { + RuntimeCall::Assets(pallet_assets::Call::transfer { .. }) => true, + RuntimeCall::Assets(pallet_assets::Call::transfer_approved { .. }) => true, + _ => false, + } + } +} + // TODO: changing depost per item and per byte to `deposit` function will require storage migration it seems parameter_types! { pub const DepositPerItem: Balance = MILLISBY / 1_000_000; @@ -677,7 +687,7 @@ impl pallet_contracts::Config for Runtime { /// and make sure they are stable. Dispatchables exposed to contracts are not allowed to /// change because that would break already deployed contracts. The `Call` structure itself /// is not allowed to change the indices of existing pallets, too. - type CallFilter = Nothing; + type CallFilter = CallRuntimeFilter; type DepositPerItem = DepositPerItem; type DepositPerByte = DepositPerByte; type DefaultDepositLimit = DefaultDepositLimit; @@ -693,7 +703,7 @@ impl pallet_contracts::Config for Runtime { type AddressGenerator = pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; type MaxStorageKeyLen = ConstU32<128>; - type UnsafeUnstableInterface = ConstBool; + type UnsafeUnstableInterface = ConstBool; type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; }