From 0e2a164921d16799c3c6001afd6687aa7e09f538 Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Sat, 27 Apr 2024 15:17:41 +0100 Subject: [PATCH 1/7] implemented logic to restore disable-runtime-api to test runtime merged changes from master --- polkadot/runtime/rococo/Cargo.toml | 14 +++++++-- polkadot/runtime/rococo/src/lib.rs | 32 ++++++++++++++----- polkadot/runtime/westend/Cargo.toml | 10 ++++-- polkadot/runtime/westend/src/lib.rs | 48 ++++++++++++++++++++--------- 4 files changed, 77 insertions(+), 27 deletions(-) diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index c78f3e668b9c..8bddaf9aa392 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -11,8 +11,13 @@ license.workspace = true workspace = true [dependencies] -parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.12", default-features = false, features = [ + "derive", + "max-encoded-len", +] } +scale-info = { version = "2.11.1", default-features = false, features = [ + "derive", +] } log = { workspace = true } serde = { workspace = true } serde_derive = { optional = true, workspace = true } @@ -80,7 +85,9 @@ pallet-scheduler = { path = "../../../substrate/frame/scheduler", default-featur pallet-session = { path = "../../../substrate/frame/session", default-features = false } pallet-society = { path = "../../../substrate/frame/society", default-features = false } pallet-sudo = { path = "../../../substrate/frame/sudo", default-features = false } -frame-support = { path = "../../../substrate/frame/support", default-features = false, features = ["tuples-96"] } +frame-support = { path = "../../../substrate/frame/support", default-features = false, features = [ + "tuples-96", +] } pallet-staking = { path = "../../../substrate/frame/staking", default-features = false } frame-system = { path = "../../../substrate/frame/system", default-features = false } frame-system-rpc-runtime-api = { path = "../../../substrate/frame/system/rpc/runtime-api", default-features = false } @@ -328,6 +335,7 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] +disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = ["rococo-runtime-constants/fast-runtime"] diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index c2614f7e96e8..063f156a9885 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -27,6 +27,7 @@ use beefy_primitives::{ }; use frame_support::{ dynamic_params::{dynamic_pallet_params, dynamic_params}, + migrations::MultiStepMigrator, traits::FromContains, }; use pallet_nis::WithMaximumOf; @@ -167,6 +168,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 0, spec_version: 1_012_000, impl_version: 0, + #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, transaction_version: 26, state_version: 1, @@ -203,6 +205,21 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::RelayChainDefaultConfig)] impl frame_system::Config for Runtime { + type RuntimeOrigin = RuntimeOrigin; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Hashing = BlakeTwo256; + type Lookup = AccountIdLookup; + type RuntimeTask = RuntimeTask; + type PalletInfo = PalletInfo; + type OnNewAccount = (); + type OnKilledAccount = (); + type OnSetCode = (); + type SingleBlockMigrations = SingleBlockMigration; + type MultiBlockMigrator = MultiStepMigrator; + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; @@ -899,19 +916,19 @@ impl InstanceFilter for ProxyType { ), ProxyType::IdentityJudgement => matches!( c, - RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) | - RuntimeCall::Utility(..) + RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) + | RuntimeCall::Utility(..) ), ProxyType::CancelProxy => { matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })) }, ProxyType::Auction => matches!( c, - RuntimeCall::Auctions { .. } | - RuntimeCall::Crowdloan { .. } | - RuntimeCall::Registrar { .. } | - RuntimeCall::Multisig(..) | - RuntimeCall::Slots { .. } + RuntimeCall::Auctions { .. } + | RuntimeCall::Crowdloan { .. } + | RuntimeCall::Registrar { .. } + | RuntimeCall::Multisig(..) + | RuntimeCall::Slots { .. } ), ProxyType::Society => matches!(c, RuntimeCall::Society(..)), ProxyType::OnDemandOrdering => matches!(c, RuntimeCall::OnDemandAssignmentProvider(..)), @@ -1755,6 +1772,7 @@ mod benches { ); } +#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index 56623272be82..c93af8282d06 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -12,8 +12,13 @@ workspace = true [dependencies] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive", "max-encoded-len"] } -scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } +parity-scale-codec = { version = "3.6.12", default-features = false, features = [ + "derive", + "max-encoded-len", +] } +scale-info = { version = "2.11.1", default-features = false, features = [ + "derive", +] } log = { workspace = true } rustc-hex = { version = "2.1.0", default-features = false } serde = { workspace = true } @@ -346,6 +351,7 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] +disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index e6790329959e..1e0aa076d287 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -159,6 +159,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 2, spec_version: 1_012_000, impl_version: 0, + #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, transaction_version: 26, state_version: 1, @@ -195,15 +196,30 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::RelayChainDefaultConfig)] impl frame_system::Config for Runtime { + type RuntimeOrigin = RuntimeOrigin; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type Hashing = BlakeTwo256; + type Lookup = AccountIdLookup; + type RuntimeTask = RuntimeTask; + type PalletInfo = PalletInfo; + type OnNewAccount = (); + type OnKilledAccount = (); + type OnSetCode = (); + type SingleBlockMigrations = SingleBlockMigration; + type MultiBlockMigrator = MultiStepMigrator; + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; + type DbWeight = RocksDbWeight; type Nonce = Nonce; type Hash = Hash; type AccountId = AccountId; type Block = Block; type BlockHashCount = BlockHashCount; - type DbWeight = RocksDbWeight; type Version = Version; type AccountData = pallet_balances::AccountData; type SystemWeightInfo = weights::frame_system::WeightInfo; @@ -1012,11 +1028,12 @@ impl InstanceFilter for ProxyType { ProxyType::Staking => { matches!( c, - RuntimeCall::Staking(..) | - RuntimeCall::Session(..) | RuntimeCall::Utility(..) | - RuntimeCall::FastUnstake(..) | - RuntimeCall::VoterList(..) | - RuntimeCall::NominationPools(..) + RuntimeCall::Staking(..) + | RuntimeCall::Session(..) + | RuntimeCall::Utility(..) + | RuntimeCall::FastUnstake(..) + | RuntimeCall::VoterList(..) + | RuntimeCall::NominationPools(..) ) }, ProxyType::NominationPools => { @@ -1032,24 +1049,24 @@ impl InstanceFilter for ProxyType { ProxyType::Governance => matches!( c, // OpenGov calls - RuntimeCall::ConvictionVoting(..) | - RuntimeCall::Referenda(..) | - RuntimeCall::Whitelist(..) + RuntimeCall::ConvictionVoting(..) + | RuntimeCall::Referenda(..) + | RuntimeCall::Whitelist(..) ), ProxyType::IdentityJudgement => matches!( c, - RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) | - RuntimeCall::Utility(..) + RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) + | RuntimeCall::Utility(..) ), ProxyType::CancelProxy => { matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })) }, ProxyType::Auction => matches!( c, - RuntimeCall::Auctions(..) | - RuntimeCall::Crowdloan(..) | - RuntimeCall::Registrar(..) | - RuntimeCall::Slots(..) + RuntimeCall::Auctions(..) + | RuntimeCall::Crowdloan(..) + | RuntimeCall::Registrar(..) + | RuntimeCall::Slots(..) ), } } @@ -1763,6 +1780,7 @@ mod benches { ); } +#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { From 278d803a6f1f93141e43a088fd21cc40575e2e0c Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Sat, 27 Apr 2024 19:07:34 +0100 Subject: [PATCH 2/7] resolved missing imports in runtimes --- polkadot/runtime/rococo/src/lib.rs | 10 +++++----- polkadot/runtime/westend/src/lib.rs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 063f156a9885..d492fc8a2edd 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -27,7 +27,6 @@ use beefy_primitives::{ }; use frame_support::{ dynamic_params::{dynamic_pallet_params, dynamic_params}, - migrations::MultiStepMigrator, traits::FromContains, }; use pallet_nis::WithMaximumOf; @@ -97,8 +96,9 @@ use sp_core::{ConstU128, ConstU8, OpaqueMetadata, H256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, Extrinsic as ExtrinsicT, - IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, + Extrinsic as ExtrinsicT, IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, + Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, @@ -215,8 +215,8 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type OnSetCode = (); - type SingleBlockMigrations = SingleBlockMigration; - type MultiBlockMigrator = MultiStepMigrator; + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); type PreInherents = (); type PostInherents = (); type PostTransactions = (); diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 1e0aa076d287..8e1e32414552 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -88,8 +88,8 @@ use sp_runtime::{ curve::PiecewiseLinear, generic, impl_opaque_keys, traits::{ - BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, IdentityLookup, - Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, + IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, @@ -206,8 +206,8 @@ impl frame_system::Config for Runtime { type OnNewAccount = (); type OnKilledAccount = (); type OnSetCode = (); - type SingleBlockMigrations = SingleBlockMigration; - type MultiBlockMigrator = MultiStepMigrator; + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); type PreInherents = (); type PostInherents = (); type PostTransactions = (); From eb90b7f059edd7efb6be265cd62841a571c0f12f Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Fri, 3 May 2024 19:19:58 +0100 Subject: [PATCH 3/7] removed runtime types that are unnecessarily implemented merged changes from master upstream --- polkadot/runtime/rococo/Cargo.toml | 2 ++ polkadot/runtime/rococo/src/lib.rs | 15 --------------- polkadot/runtime/westend/Cargo.toml | 2 ++ polkadot/runtime/westend/src/lib.rs | 15 --------------- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index 8bddaf9aa392..f540249fbc0b 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -335,6 +335,8 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] + +# When enabled, the runtime API will not be built. disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index d492fc8a2edd..41d03e60ad78 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -205,21 +205,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::RelayChainDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Hashing = BlakeTwo256; - type Lookup = AccountIdLookup; - type RuntimeTask = RuntimeTask; - type PalletInfo = PalletInfo; - type OnNewAccount = (); - type OnKilledAccount = (); - type OnSetCode = (); - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index c93af8282d06..fddbb48b6297 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -351,6 +351,8 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] + +# When enabled, the runtime API will not be built. disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 8e1e32414552..9a72a5b244f5 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -196,21 +196,6 @@ parameter_types! { #[derive_impl(frame_system::config_preludes::RelayChainDefaultConfig)] impl frame_system::Config for Runtime { - type RuntimeOrigin = RuntimeOrigin; - type RuntimeEvent = RuntimeEvent; - type RuntimeCall = RuntimeCall; - type Hashing = BlakeTwo256; - type Lookup = AccountIdLookup; - type RuntimeTask = RuntimeTask; - type PalletInfo = PalletInfo; - type OnNewAccount = (); - type OnKilledAccount = (); - type OnSetCode = (); - type SingleBlockMigrations = (); - type MultiBlockMigrator = (); - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; From d6da96284c214b9f6e6b55cfc00dc7bf3fe3a9aa Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Thu, 30 May 2024 22:04:48 +0100 Subject: [PATCH 4/7] deleted unneccessary comment change after conflict merge --- polkadot/runtime/rococo/Cargo.toml | 2 +- polkadot/runtime/westend/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index f540249fbc0b..b1f64f2a6f5a 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -336,7 +336,7 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] -# When enabled, the runtime API will not be built. +# If enabled, the runtime apis will not be exposed by the runtime. disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index fddbb48b6297..200f1ac402eb 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -352,7 +352,7 @@ try-runtime = [ # Enable the metadata hash generation in the wasm builder. metadata-hash = ["substrate-wasm-builder/metadata-hash"] -# When enabled, the runtime API will not be built. +# If enabled, the runtime apis will not be exposed by the runtime. disable-runtime-api = [] # Set timing constants (e.g. session period) to faster versions to speed up testing. From e1a1c8e8cc62a60c888865effcc86820835819ff Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Mon, 20 May 2024 05:49:14 +0100 Subject: [PATCH 5/7] reverted unrelated changes and merged changes --- polkadot/runtime/rococo/Cargo.toml | 9 ++------- polkadot/runtime/westend/Cargo.toml | 11 +++-------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index b1f64f2a6f5a..e9336b69a5ba 100644 --- a/polkadot/runtime/rococo/Cargo.toml +++ b/polkadot/runtime/rococo/Cargo.toml @@ -11,13 +11,8 @@ license.workspace = true workspace = true [dependencies] -parity-scale-codec = { version = "3.6.12", default-features = false, features = [ - "derive", - "max-encoded-len", -] } -scale-info = { version = "2.11.1", default-features = false, features = [ - "derive", -] } +parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive", "max-encoded-len"] } +scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } log = { workspace = true } serde = { workspace = true } serde_derive = { optional = true, workspace = true } diff --git a/polkadot/runtime/westend/Cargo.toml b/polkadot/runtime/westend/Cargo.toml index 200f1ac402eb..5ff4efafd86a 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -11,19 +11,14 @@ license.workspace = true workspace = true [dependencies] -bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -parity-scale-codec = { version = "3.6.12", default-features = false, features = [ - "derive", - "max-encoded-len", -] } -scale-info = { version = "2.11.1", default-features = false, features = [ - "derive", -] } +parity-scale-codec = { version = "3.6.12", default-features = false, features = ["derive", "max-encoded-len"] } +scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } log = { workspace = true } rustc-hex = { version = "2.1.0", default-features = false } serde = { workspace = true } serde_derive = { optional = true, workspace = true } smallvec = "1.8.0" +bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } authority-discovery-primitives = { package = "sp-authority-discovery", path = "../../../substrate/primitives/authority-discovery", default-features = false } babe-primitives = { package = "sp-consensus-babe", path = "../../../substrate/primitives/consensus/babe", default-features = false } From d84e98667f322c14acc29f648add07b00117dad5 Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Thu, 30 May 2024 21:57:36 +0100 Subject: [PATCH 6/7] removed unnecessary changes in implementation --- polkadot/runtime/rococo/src/lib.rs | 19 ++++++++--------- polkadot/runtime/westend/src/lib.rs | 32 ++++++++++++++--------------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/polkadot/runtime/rococo/src/lib.rs b/polkadot/runtime/rococo/src/lib.rs index 41d03e60ad78..dddd6936c45c 100644 --- a/polkadot/runtime/rococo/src/lib.rs +++ b/polkadot/runtime/rococo/src/lib.rs @@ -96,9 +96,8 @@ use sp_core::{ConstU128, ConstU8, OpaqueMetadata, H256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, - Extrinsic as ExtrinsicT, IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, - Verify, + BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, Extrinsic as ExtrinsicT, + IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, FixedU128, KeyTypeId, Perbill, Percent, Permill, RuntimeDebug, @@ -901,19 +900,19 @@ impl InstanceFilter for ProxyType { ), ProxyType::IdentityJudgement => matches!( c, - RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) - | RuntimeCall::Utility(..) + RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) | + RuntimeCall::Utility(..) ), ProxyType::CancelProxy => { matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })) }, ProxyType::Auction => matches!( c, - RuntimeCall::Auctions { .. } - | RuntimeCall::Crowdloan { .. } - | RuntimeCall::Registrar { .. } - | RuntimeCall::Multisig(..) - | RuntimeCall::Slots { .. } + RuntimeCall::Auctions { .. } | + RuntimeCall::Crowdloan { .. } | + RuntimeCall::Registrar { .. } | + RuntimeCall::Multisig(..) | + RuntimeCall::Slots { .. } ), ProxyType::Society => matches!(c, RuntimeCall::Society(..)), ProxyType::OnDemandOrdering => matches!(c, RuntimeCall::OnDemandAssignmentProvider(..)), diff --git a/polkadot/runtime/westend/src/lib.rs b/polkadot/runtime/westend/src/lib.rs index 9a72a5b244f5..ca7244c43ccc 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -88,7 +88,7 @@ use sp_runtime::{ curve::PiecewiseLinear, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, + BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, IdentityLookup, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, @@ -1013,12 +1013,12 @@ impl InstanceFilter for ProxyType { ProxyType::Staking => { matches!( c, - RuntimeCall::Staking(..) - | RuntimeCall::Session(..) - | RuntimeCall::Utility(..) - | RuntimeCall::FastUnstake(..) - | RuntimeCall::VoterList(..) - | RuntimeCall::NominationPools(..) + RuntimeCall::Staking(..) | + RuntimeCall::Session(..) | + RuntimeCall::Utility(..) | + RuntimeCall::FastUnstake(..) | + RuntimeCall::VoterList(..) | + RuntimeCall::NominationPools(..) ) }, ProxyType::NominationPools => { @@ -1034,24 +1034,24 @@ impl InstanceFilter for ProxyType { ProxyType::Governance => matches!( c, // OpenGov calls - RuntimeCall::ConvictionVoting(..) - | RuntimeCall::Referenda(..) - | RuntimeCall::Whitelist(..) + RuntimeCall::ConvictionVoting(..) | + RuntimeCall::Referenda(..) | + RuntimeCall::Whitelist(..) ), ProxyType::IdentityJudgement => matches!( c, - RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) - | RuntimeCall::Utility(..) + RuntimeCall::Identity(pallet_identity::Call::provide_judgement { .. }) | + RuntimeCall::Utility(..) ), ProxyType::CancelProxy => { matches!(c, RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. })) }, ProxyType::Auction => matches!( c, - RuntimeCall::Auctions(..) - | RuntimeCall::Crowdloan(..) - | RuntimeCall::Registrar(..) - | RuntimeCall::Slots(..) + RuntimeCall::Auctions(..) | + RuntimeCall::Crowdloan(..) | + RuntimeCall::Registrar(..) | + RuntimeCall::Slots(..) ), } } From 05c0c4eba2c0f56ad5f0d23908a3a0464dbd1a24 Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Thu, 30 May 2024 22:26:34 +0100 Subject: [PATCH 7/7] added prdoc for pull request --- prdoc/pr_4325.prdoc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 prdoc/pr_4325.prdoc diff --git a/prdoc/pr_4325.prdoc b/prdoc/pr_4325.prdoc new file mode 100644 index 000000000000..2cdc3393d69f --- /dev/null +++ b/prdoc/pr_4325.prdoc @@ -0,0 +1,14 @@ +title: Restore disable_runtime_api logic to test nodes + +doc: + - audience: Runtime Dev + description: | + There should be an option for runtime dev to choose whether to expose apis. This feature existed but was mistakenly removed. + +crates: + - name: polkadot-runtime-rococo + bump: patch + + - name: polkadot-runtime-westend + bump: patch +