Remove migration code. (#5291)

* Remove migration code.

* Fix cargo

* Bump spec version
This commit is contained in:
Gavin Wood
2020-03-19 23:01:13 +01:00
committed by GitHub
parent 81da73475c
commit 7947cbf915
61 changed files with 61 additions and 514 deletions
-32
View File
@@ -151,13 +151,6 @@ decl_error! {
decl_storage! {
trait Store for Module<T: Trait> as GrandpaFinality {
/// DEPRECATED
///
/// This used to store the current authority set, which has been migrated to the well-known
/// GRANDPA_AUTHORITIES_KEY unhashed key.
#[cfg(feature = "migrate-authorities")]
pub(crate) Authorities get(fn authorities): AuthorityList;
/// State of the current authority set.
State get(fn state): StoredState<T::BlockNumber> = StoredState::Live;
@@ -184,15 +177,6 @@ decl_storage! {
}
}
mod migration {
use super::*;
pub fn migrate<T: Trait>() {
for i in 0..=CurrentSetId::get() {
SetIdSession::migrate_key_from_blake(i);
}
}
}
decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
type Error = Error<T>;
@@ -205,15 +189,6 @@ decl_module! {
// FIXME: https://github.com/paritytech/substrate/issues/1112
}
fn on_runtime_upgrade() {
migration::migrate::<T>();
}
fn on_initialize() {
#[cfg(feature = "migrate-authorities")]
Self::migrate_authorities();
}
fn on_finalize(block_number: T::BlockNumber) {
// check for scheduled pending authority set changes
if let Some(pending_change) = <PendingChange<T>>::get() {
@@ -384,13 +359,6 @@ impl<T: Trait> Module<T> {
Self::set_grandpa_authorities(authorities);
}
}
#[cfg(feature = "migrate-authorities")]
fn migrate_authorities() {
if Authorities::exists() {
Self::set_grandpa_authorities(&Authorities::take());
}
}
}
impl<T: Trait> Module<T> {