Remove migration code. (#910)

* Remove migration code.

* Bump Substrate

* Bump runtime
This commit is contained in:
Gavin Wood
2020-03-21 13:37:55 +01:00
committed by GitHub
parent 17f6b4b8fb
commit 6a7374aca3
12 changed files with 361 additions and 346 deletions
+350 -314
View File
File diff suppressed because it is too large Load Diff
+1 -18
View File
@@ -141,19 +141,6 @@ decl_storage! {
} }
} }
mod migration {
use super::*;
pub fn migrate<T: Trait>() {
if let Ok(addresses) = Vec::<EthereumAddress>::decode(&mut &include_bytes!("./claims.scale")[..]) {
for i in &addresses {
Vesting::<T>::migrate_key_from_blake(i);
Claims::<T>::migrate_key_from_blake(i);
}
}
}
}
decl_module! { decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin { pub struct Module<T: Trait> for enum Call where origin: T::Origin {
type Error = Error<T>; type Error = Error<T>;
@@ -164,10 +151,6 @@ decl_module! {
/// Deposit one of this module's events by using the default implementation. /// Deposit one of this module's events by using the default implementation.
fn deposit_event() = default; fn deposit_event() = default;
fn on_runtime_upgrade() {
migration::migrate::<T>();
}
/// Make a claim to collect your DOTs. /// Make a claim to collect your DOTs.
/// ///
/// The dispatch origin for this call must be _None_. /// The dispatch origin for this call must be _None_.
@@ -412,7 +395,7 @@ mod tests {
type Version = (); type Version = ();
type ModuleToIndex = (); type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>; type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = Balances; type OnKilledAccount = Balances;
} }
+1 -1
View File
@@ -615,7 +615,7 @@ mod tests {
type Version = (); type Version = ();
type ModuleToIndex = (); type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>; type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = Balances; type OnKilledAccount = Balances;
} }
parameter_types! { parameter_types! {
+1 -1
View File
@@ -938,7 +938,7 @@ mod tests {
type Version = (); type Version = ();
type ModuleToIndex = (); type ModuleToIndex = ();
type AccountData = balances::AccountData<u128>; type AccountData = balances::AccountData<u128>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = (); type OnKilledAccount = ();
} }
+1 -1
View File
@@ -704,7 +704,7 @@ mod tests {
type Version = (); type Version = ();
type ModuleToIndex = (); type ModuleToIndex = ();
type AccountData = balances::AccountData<u128>; type AccountData = balances::AccountData<u128>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = Balances; type OnKilledAccount = Balances;
} }
+1 -1
View File
@@ -916,7 +916,7 @@ mod tests {
type Version = (); type Version = ();
type ModuleToIndex = (); type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>; type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = Balances; type OnKilledAccount = Balances;
} }
+1 -1
View File
@@ -39,7 +39,7 @@ democracy = { package = "pallet-democracy", git = "https://github.com/paritytech
elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = ["migrate-authorities"] } grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
+1 -5
View File
@@ -78,7 +78,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"), spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"), impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2, authoring_version: 2,
spec_version: 1054, spec_version: 1055,
impl_version: 1, impl_version: 1,
apis: RUNTIME_API_VERSIONS, apis: RUNTIME_API_VERSIONS,
}; };
@@ -138,10 +138,6 @@ impl system::Trait for Runtime {
type Version = Version; type Version = Version;
type ModuleToIndex = ModuleToIndex; type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>; type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (
Balances, Identity, ElectionsPhragmen, Society, Session, Staking, Recovery, Democracy,
Vesting, ImOnline
);
type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = (); type OnKilledAccount = ();
} }
+1 -1
View File
@@ -38,7 +38,7 @@ democracy = { package = "pallet-democracy", git = "https://github.com/paritytech
elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } elections-phragmen = { package = "pallet-elections-phragmen", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = ["migrate-authorities"] } grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } identity = { package = "pallet-identity", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } im-online = { package = "pallet-im-online", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
+1 -1
View File
@@ -146,7 +146,7 @@ impl system::Trait for Runtime {
type Version = Version; type Version = Version;
type ModuleToIndex = ModuleToIndex; type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>; type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = (); type OnKilledAccount = ();
} }
+1 -1
View File
@@ -33,7 +33,7 @@ transaction-payment = { package = "pallet-transaction-payment", git = "https://g
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } executive = { package = "frame-executive", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } finality-tracker = { package = "pallet-finality-tracker", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false, features = ["migrate-authorities"] } grandpa = { package = "pallet-grandpa", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } indices = { package = "pallet-indices", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } nicks = { package = "pallet-nicks", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false } randomness-collective-flip = { package = "pallet-randomness-collective-flip", git = "https://github.com/paritytech/substrate", branch = "polkadot-master", default-features = false }
+1 -1
View File
@@ -133,7 +133,7 @@ impl system::Trait for Runtime {
type Version = Version; type Version = Version;
type ModuleToIndex = ModuleToIndex; type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>; type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (); type OnNewAccount = (); type OnNewAccount = ();
type OnKilledAccount = (); type OnKilledAccount = ();
} }