Remove Old Migration Code (#5870)

* remove old migration code

* Remove old staking

* Remove indices migration

* Remove upgrade test in transaction-payment

* oops

* Revert "Remove old staking"

This reverts commit 95262b1ac43c9b5bcf49d2ae80800feabcbbbaa0.

* remove migration test in staking

* fix warnings
This commit is contained in:
Shawn Tabrizi
2020-05-03 10:54:21 +02:00
committed by GitHub
parent b913dfebb7
commit 92d0c0b769
6 changed files with 1 additions and 298 deletions
-25
View File
@@ -525,12 +525,6 @@ decl_module! {
fn deposit_event() = default;
fn on_runtime_upgrade() -> Weight {
Self::migrate();
0
}
/// Propose a sensitive action to be taken.
///
/// The dispatch origin of this call must be _Signed_ and the sender must
@@ -1268,25 +1262,6 @@ decl_module! {
}
impl<T: Trait> Module<T> {
fn migrate() {
use frame_support::{Twox64Concat, migration::{StorageKeyIterator, remove_storage_prefix}};
remove_storage_prefix(b"Democracy", b"VotesOf", &[]);
remove_storage_prefix(b"Democracy", b"VotersFor", &[]);
remove_storage_prefix(b"Democracy", b"Delegations", &[]);
for (who, (end, proposal_hash, threshold, delay))
in StorageKeyIterator::<
ReferendumIndex,
(T::BlockNumber, T::Hash, VoteThreshold, T::BlockNumber),
Twox64Concat,
>::new(b"Democracy", b"ReferendumInfoOf").drain()
{
let status = ReferendumStatus {
end, proposal_hash, threshold, delay, tally: Tally::default()
};
ReferendumInfoOf::<T>::insert(who, ReferendumInfo::Ongoing(status))
}
}
// exposed immutables.
/// Get the amount locked in support of `proposal`; `None` if proposal isn't a valid proposal