mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Companion for substrate#8724 (#2994)
* runtime: create migrations for grandpa storage prefix * runtime: address review comments * runtime: update spec_version * westend: fix incorrect merge * runtime: change to v3.1 from v4 for grandpa migrations * cargo.lock: manually specify pallet-grandpa in lock file * cargo.lock: fix typo * update substrate * update substrate Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
Generated
+160
-157
File diff suppressed because it is too large
Load Diff
@@ -1470,6 +1470,31 @@ construct_runtime! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct GrandpaStoragePrefixMigration;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for GrandpaStoragePrefixMigration {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::migrate::<Runtime, Grandpa, _>(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn pre_upgrade() -> Result<(), &'static str> {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::pre_migration::<Runtime, Grandpa, _>(name);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn post_upgrade() -> Result<(), &'static str> {
|
||||||
|
pallet_grandpa::migrations::v3_1::post_migration::<Grandpa>();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// The address format for describing accounts.
|
||||||
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
||||||
/// Block header type as expected by this runtime.
|
/// Block header type as expected by this runtime.
|
||||||
@@ -1499,6 +1524,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllPallets,
|
AllPallets,
|
||||||
|
GrandpaStoragePrefixMigration,
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in the transactions.
|
/// The payload being signed in the transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|||||||
@@ -1032,6 +1032,31 @@ construct_runtime! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct GrandpaStoragePrefixMigration;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for GrandpaStoragePrefixMigration {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::migrate::<Runtime, Grandpa, _>(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn pre_upgrade() -> Result<(), &'static str> {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::pre_migration::<Runtime, Grandpa, _>(name);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn post_upgrade() -> Result<(), &'static str> {
|
||||||
|
pallet_grandpa::migrations::v3_1::post_migration::<Grandpa>();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// The address format for describing accounts.
|
||||||
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
||||||
/// Block header type as expected by this runtime.
|
/// Block header type as expected by this runtime.
|
||||||
@@ -1062,7 +1087,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllPallets,
|
AllPallets,
|
||||||
(),
|
GrandpaStoragePrefixMigration,
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllPallets,
|
AllPallets,
|
||||||
(),
|
GrandpaStoragePrefixMigration,
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
@@ -257,6 +257,31 @@ construct_runtime! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct GrandpaStoragePrefixMigration;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for GrandpaStoragePrefixMigration {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::migrate::<Runtime, Grandpa, _>(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn pre_upgrade() -> Result<(), &'static str> {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::pre_migration::<Runtime, Grandpa, _>(name);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn post_upgrade() -> Result<(), &'static str> {
|
||||||
|
pallet_grandpa::migrations::v3_1::post_migration::<Grandpa>();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub struct BaseFilter;
|
pub struct BaseFilter;
|
||||||
impl Filter<Call> for BaseFilter {
|
impl Filter<Call> for BaseFilter {
|
||||||
fn filter(_call: &Call) -> bool {
|
fn filter(_call: &Call) -> bool {
|
||||||
|
|||||||
@@ -1060,6 +1060,31 @@ construct_runtime! {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct GrandpaStoragePrefixMigration;
|
||||||
|
impl frame_support::traits::OnRuntimeUpgrade for GrandpaStoragePrefixMigration {
|
||||||
|
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::migrate::<Runtime, Grandpa, _>(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn pre_upgrade() -> Result<(), &'static str> {
|
||||||
|
use frame_support::traits::PalletInfo;
|
||||||
|
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Grandpa>()
|
||||||
|
.expect("grandpa is part of pallets in construct_runtime, so it has a name; qed");
|
||||||
|
pallet_grandpa::migrations::v3_1::pre_migration::<Runtime, Grandpa, _>(name);
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "try-runtime")]
|
||||||
|
fn post_upgrade() -> Result<(), &'static str> {
|
||||||
|
pallet_grandpa::migrations::v3_1::post_migration::<Grandpa>();
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The address format for describing accounts.
|
/// The address format for describing accounts.
|
||||||
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
pub type Address = sp_runtime::MultiAddress<AccountId, ()>;
|
||||||
/// Block header type as expected by this runtime.
|
/// Block header type as expected by this runtime.
|
||||||
@@ -1089,6 +1114,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
frame_system::ChainContext<Runtime>,
|
frame_system::ChainContext<Runtime>,
|
||||||
Runtime,
|
Runtime,
|
||||||
AllPallets,
|
AllPallets,
|
||||||
|
GrandpaStoragePrefixMigration,
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||||
|
|||||||
Reference in New Issue
Block a user