Bring back runtime upgrade test (#525)

This brings back the runtime upgrade test and also updates Substrate &
Polkadot.
This commit is contained in:
Bastian Köcher
2021-07-06 16:21:19 +02:00
committed by GitHub
parent d0b57c1ad4
commit a2a97be872
11 changed files with 362 additions and 329 deletions
-20
View File
@@ -253,15 +253,6 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
parameter_types! {
pub storage ParachainId: cumulus_primitives_core::ParaId = 100.into();
pub storage UpgradeDetection: bool = false;
}
pub struct UpgradeDetectionOnRuntimeUpgrade;
impl frame_support::traits::OnRuntimeUpgrade for UpgradeDetectionOnRuntimeUpgrade {
fn on_runtime_upgrade() -> u64 {
UpgradeDetection::set(&true);
0
}
}
construct_runtime! {
@@ -326,7 +317,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
UpgradeDetectionOnRuntimeUpgrade,
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
@@ -336,10 +326,6 @@ decl_runtime_apis! {
/// Returns the last timestamp of a runtime.
fn get_last_timestamp() -> u64;
}
pub trait GetUpgradeDetection {
/// Returns `true` if the runtime has been upgraded at least once.
fn has_upgraded() -> bool;
}
}
impl_runtime_apis! {
@@ -417,12 +403,6 @@ impl_runtime_apis! {
}
}
impl crate::GetUpgradeDetection<Block> for Runtime {
fn has_upgraded() -> bool {
UpgradeDetection::get()
}
}
impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {
fn collect_collation_info() -> cumulus_primitives_core::CollationInfo {
ParachainSystem::collect_collation_info()