Skip to content

Commit

Permalink
Revert "implemented logic to restore disable-runtime-api to test runt…
Browse files Browse the repository at this point in the history
…ime"

This reverts commit c494b17.
  • Loading branch information
bolajahmad committed Apr 30, 2024
1 parent ec264cd commit 494c221
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 83 deletions.
15 changes: 3 additions & 12 deletions polkadot/runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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"]

Expand Down
32 changes: 7 additions & 25 deletions polkadot/runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<AccountId, ()>;
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<IsIdentityCall>;
type BlockWeights = BlockWeights;
type BlockLength = BlockLength;
Expand Down Expand Up @@ -910,19 +893,19 @@ impl InstanceFilter<RuntimeCall> 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(..)),
Expand Down Expand Up @@ -1761,7 +1744,6 @@ mod benches {
);
}

#[cfg(not(feature = "disable-runtime-api"))]
sp_api::impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion {
Expand Down
16 changes: 3 additions & 13 deletions polkadot/runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 = []

Expand Down
48 changes: 15 additions & 33 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<AccountId, ()>;
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<IsIdentityCall>;
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<Balance>;
type SystemWeightInfo = weights::frame_system::WeightInfo<Runtime>;
Expand Down Expand Up @@ -1023,12 +1007,11 @@ impl InstanceFilter<RuntimeCall> 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 => {
Expand All @@ -1044,24 +1027,24 @@ impl InstanceFilter<RuntimeCall> 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(..)
),
}
}
Expand Down Expand Up @@ -1741,7 +1724,6 @@ mod benches {
);
}

#[cfg(not(feature = "disable-runtime-api"))]
sp_api::impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
fn version() -> RuntimeVersion {
Expand Down

0 comments on commit 494c221

Please sign in to comment.