Skip to content

Commit

Permalink
introduce config param to fetch state version instead using a default…
Browse files Browse the repository at this point in the history
… one
  • Loading branch information
vedhavyas committed Sep 26, 2023
1 parent fa4c672 commit 9f9902e
Show file tree
Hide file tree
Showing 184 changed files with 836 additions and 239 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions bridges/bin/runtime-common/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ parameter_types! {
pub const MaxUnrewardedRelayerEntriesAtInboundLane: MessageNonce = 16;
pub const MaxUnconfirmedMessagesAtInboundLane: MessageNonce = 1_000;
pub const ReserveId: [u8; 8] = *b"brdgrlrs";
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for TestRuntime {
Expand All @@ -170,6 +171,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_utility::Config for TestRuntime {
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/grandpa/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ parameter_types! {
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::one();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for TestRuntime {
Expand All @@ -79,6 +80,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

parameter_types! {
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/messages/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ parameter_types! {
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::one();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

pub type DbWeight = RocksDbWeight;
Expand Down Expand Up @@ -117,6 +118,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_balances::Config for TestRuntime {
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/parachains/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ parameter_types! {
pub const MaximumBlockWeight: Weight = Weight::from_parts(1024, 0);
pub const MaximumBlockLength: u32 = 2 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::one();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for TestRuntime {
Expand All @@ -183,6 +184,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

parameter_types! {
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/relayers/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ parameter_types! {
pub const ReserveId: [u8; 8] = *b"brdgrlrs";
pub const Stake: Balance = 1_000;
pub const Lease: BlockNumber = 8;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for TestRuntime {
Expand All @@ -85,6 +86,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_balances::Config for TestRuntime {
Expand Down
2 changes: 2 additions & 0 deletions bridges/modules/xcm-bridge-hub-router/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ parameter_types! {
pub BridgeFeeAsset: AssetId = MultiLocation::parent().into();
pub BridgeTable: Vec<(NetworkId, MultiLocation, Option<MultiAsset>)>
= vec![(BridgedNetworkId::get(), SiblingBridgeHubLocation::get(), Some((BridgeFeeAsset::get(), BASE_FEE).into()))];
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for TestRuntime {
Expand All @@ -81,6 +82,7 @@ impl frame_system::Config for TestRuntime {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_xcm_bridge_hub_router::Config<()> for TestRuntime {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ frame_support::construct_runtime!(
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const SS58Prefix: u8 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl system::Config for Test {
Expand All @@ -74,6 +75,7 @@ impl system::Config for Test {
type SS58Prefix = SS58Prefix;
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

parameter_types! {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/pallets/dmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ mod tests {
pub const ParachainId: ParaId = ParaId::new(200);
pub const ReservedXcmpWeight: Weight = Weight::zero();
pub const ReservedDmpWeight: Weight = Weight::zero();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

type AccountId = u64;
Expand Down Expand Up @@ -477,6 +478,7 @@ mod tests {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

thread_local! {
Expand Down
3 changes: 3 additions & 0 deletions cumulus/pallets/parachain-system/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ parameter_types! {
pub const ParachainId: ParaId = ParaId::new(200);
pub const ReservedXcmpWeight: Weight = Weight::zero();
pub const ReservedDmpWeight: Weight = Weight::zero();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for Test {
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
Expand All @@ -96,6 +98,7 @@ impl frame_system::Config for Test {
type SS58Prefix = ();
type OnSetCode = ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}
impl Config for Test {
type RuntimeEvent = RuntimeEvent;
Expand Down
2 changes: 2 additions & 0 deletions cumulus/pallets/xcmp-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ frame_support::construct_runtime!(
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const SS58Prefix: u8 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

type AccountId = u64;
Expand Down Expand Up @@ -78,6 +79,7 @@ impl frame_system::Config for Test {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Test>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

parameter_types! {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/parachain-template/pallets/template/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ frame_support::construct_runtime!(
parameter_types! {
pub const BlockHashCount: u64 = 250;
pub const SS58Prefix: u8 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl system::Config for Test {
Expand All @@ -46,6 +47,7 @@ impl system::Config for Test {
type SS58Prefix = SS58Prefix;
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl crate::Config for Test {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u16 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -318,6 +319,7 @@ impl frame_system::Config for Runtime {
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/parachains/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ mod tests {
pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024);
pub const AvailableBlockRatio: Perbill = Perbill::one();
pub const MaxReserves: u32 = 50;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for Test {
Expand All @@ -179,6 +180,7 @@ mod tests {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_balances::Config for Test {
Expand Down
5 changes: 5 additions & 0 deletions cumulus/parachains/pallets/collective-content/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ impl pallet_collective_content::Config for Test {
type WeightInfo = CCWeightInfo;
}

parameter_types! {
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for Test {
type BaseCallFilter = ();
type BlockWeights = ();
Expand All @@ -79,6 +83,7 @@ impl frame_system::Config for Test {
type SS58Prefix = ();
type OnSetCode = ();
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}
pub struct CCWeightInfo;
impl WeightInfo for CCWeightInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 2;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -190,6 +191,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 0;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -200,6 +201,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -169,6 +170,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 2;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -214,6 +215,7 @@ impl frame_system::Config for Runtime {
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 0;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -214,6 +215,7 @@ impl frame_system::Config for Runtime {
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u16 = 42;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -231,6 +232,7 @@ impl frame_system::Config for Runtime {
/// The action to take on a Runtime Upgrade
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ parameter_types! {
})
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -181,6 +182,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = ConstU16<0>;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ parameter_types! {
})
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -190,6 +191,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = ConstU16<42>;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

impl pallet_timestamp::Config for Runtime {
Expand Down
2 changes: 2 additions & 0 deletions cumulus/parachains/runtimes/glutton/glutton-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ parameter_types! {
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
pub const SS58Prefix: u8 = 2;
pub const ExtrinsicsRootStateVersion: sp_core::storage::StateVersion = sp_core::storage::StateVersion::V0;
}

impl frame_system::Config for Runtime {
Expand All @@ -176,6 +177,7 @@ impl frame_system::Config for Runtime {
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode<Self>;
type MaxConsumers = frame_support::traits::ConstU32<16>;
type ExtrinsicsRootStateVersion = ExtrinsicsRootStateVersion;
}

parameter_types! {
Expand Down
Loading

0 comments on commit 9f9902e

Please sign in to comment.