From 494c2219aba6cb9ccf7384407d476ca1b8882423 Mon Sep 17 00:00:00 2001 From: Bolaji Ahmad <56865496+bolajahmad@users.noreply.github.com> Date: Tue, 30 Apr 2024 19:20:58 +0100 Subject: [PATCH] Revert "implemented logic to restore disable-runtime-api to test runtime" This reverts commit c494b17e0ab0bdd31f650833251895b84170f95c. --- polkadot/runtime/rococo/Cargo.toml | 15 ++------- polkadot/runtime/rococo/src/lib.rs | 32 +++++-------------- polkadot/runtime/westend/Cargo.toml | 16 ++-------- polkadot/runtime/westend/src/lib.rs | 48 +++++++++-------------------- 4 files changed, 28 insertions(+), 83 deletions(-) diff --git a/polkadot/runtime/rococo/Cargo.toml b/polkadot/runtime/rococo/Cargo.toml index f50bb96f6b41a..bbe19310f970a 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.1", 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.1", 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 } @@ -85,9 +80,7 @@ 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 } @@ -330,8 +323,6 @@ try-runtime = [ "sp-runtime/try-runtime", ] -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 873e2646f508c..287ae9937da4b 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; @@ -164,7 +163,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 0, spec_version: 1_010_000, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, transaction_version: 24, state_version: 1, @@ -201,21 +199,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 = SingleBlockMigration; - type MultiBlockMigrator = MultiStepMigrator; - type PreInherents = (); - type PostInherents = (); - type PostTransactions = (); type BaseCallFilter = EverythingBut; type BlockWeights = BlockWeights; type BlockLength = BlockLength; @@ -910,19 +893,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(..)), @@ -1761,7 +1744,6 @@ 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 a530a1b6709f0..d726adfb8e6e4 100644 --- a/polkadot/runtime/westend/Cargo.toml +++ b/polkadot/runtime/westend/Cargo.toml @@ -12,13 +12,8 @@ workspace = true [dependencies] bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -parity-scale-codec = { version = "3.6.1", 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.1", 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 } @@ -50,10 +45,7 @@ sp-npos-elections = { path = "../../../substrate/primitives/npos-elections", def frame-election-provider-support = { path = "../../../substrate/frame/election-provider-support", default-features = false } frame-executive = { path = "../../../substrate/frame/executive", default-features = false } -frame-support = { path = "../../../substrate/frame/support", default-features = false, features = [ - "experimental", - "tuples-96", -] } +frame-support = { path = "../../../substrate/frame/support", default-features = false, features = ["experimental", "tuples-96"] } frame-system = { path = "../../../substrate/frame/system", default-features = false } frame-system-rpc-runtime-api = { path = "../../../substrate/frame/system/rpc/runtime-api", default-features = false } westend-runtime-constants = { package = "westend-runtime-constants", path = "constants", default-features = false } @@ -345,8 +337,6 @@ try-runtime = [ "sp-runtime/try-runtime", ] -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 6244fd292b6f1..7125f5d34c408 100644 --- a/polkadot/runtime/westend/src/lib.rs +++ b/polkadot/runtime/westend/src/lib.rs @@ -155,7 +155,6 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { authoring_version: 2, spec_version: 1_010_000, impl_version: 0, - #[cfg(not(feature = "disable-runtime-api"))] apis: RUNTIME_API_VERSIONS, transaction_version: 24, state_version: 1, @@ -192,30 +191,15 @@ 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; @@ -1023,12 +1007,11 @@ 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 => { @@ -1044,24 +1027,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(..) ), } } @@ -1741,7 +1724,6 @@ mod benches { ); } -#[cfg(not(feature = "disable-runtime-api"))] sp_api::impl_runtime_apis! { impl sp_api::Core for Runtime { fn version() -> RuntimeVersion {