From 64d0fe3154e54851aa6cca650a314f74ecf7ae7b Mon Sep 17 00:00:00 2001 From: Dmitry Sinyavin Date: Thu, 16 May 2024 10:19:27 +0200 Subject: [PATCH 1/2] Filter out credit purchase call --- .../coretime/coretime-kusama/src/lib.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/system-parachains/coretime/coretime-kusama/src/lib.rs b/system-parachains/coretime/coretime-kusama/src/lib.rs index a0871ce399..0ff303ef0d 100644 --- a/system-parachains/coretime/coretime-kusama/src/lib.rs +++ b/system-parachains/coretime/coretime-kusama/src/lib.rs @@ -37,7 +37,8 @@ use frame_support::{ genesis_builder_helper::{build_config, create_default_config}, parameter_types, traits::{ - ConstBool, ConstU32, ConstU64, ConstU8, EitherOfDiverse, InstanceFilter, TransformOrigin, + ConstBool, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, EverythingBut, + InstanceFilter, TransformOrigin, }, weights::{ConstantMultiplier, Weight}, PalletId, @@ -170,9 +171,19 @@ parameter_types! { pub const SS58Prefix: u8 = 2; } +/// Filter out credit purchase calls until the credit system is implemented. Otherwise, users +/// may have chance of locking their funds forever on purchased credits they cannot use. +pub struct IsBrokerCreditPurchaseCall; +impl Contains for IsBrokerCreditPurchaseCall { + fn contains(c: &RuntimeCall) -> bool { + matches!(c, RuntimeCall::Broker(pallet_broker::Call::purchase_credit { .. })) + } +} + // Configure FRAME pallets to include in runtime. #[derive_impl(frame_system::config_preludes::ParaChainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { + type BaseCallFilter = EverythingBut; /// The identifier used to distinguish between accounts. type AccountId = AccountId; /// The nonce type for storing how many extrinsics an account has signed. From 0b664913e70621c47a6fec5a8366f734dfbe3631 Mon Sep 17 00:00:00 2001 From: Dmitry Sinyavin Date: Thu, 16 May 2024 10:25:58 +0200 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7843d2668b..6c99166092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Kusama chains: allow arbitrary XCM execution ([polkadot-fellows/runtimes#261](https://github.com/polkadot-fellows/runtimes/pull/261)) - Allow everything through XCM SafeCallFilter ([polkadot-fellows/runtimes#285](https://github.com/polkadot-fellows/runtimes/pull/285)) +- Disable Coretime credit purchasing until we have the credit system implemented ([polkadot-fellows/runtimes#312](https://github.com/polkadot-fellows/runtimes/pull/312)) ### Removed