Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Remove migration code. (#910)
Browse files Browse the repository at this point in the history
* Remove migration code.

* Bump Substrate

* Bump runtime
  • Loading branch information
gavofyork authored Mar 21, 2020
1 parent 3a6c33f commit e19d50b
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 346 deletions.
664 changes: 350 additions & 314 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 1 addition & 18 deletions runtime/common/src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
type Error = Error<T>;
Expand All @@ -164,10 +151,6 @@ decl_module! {
/// Deposit one of this module's events by using the default implementation.
fn deposit_event() = default;

fn on_runtime_upgrade() {
migration::migrate::<T>();
}

/// Make a claim to collect your DOTs.
///
/// The dispatch origin for this call must be _None_.
Expand Down Expand Up @@ -412,7 +395,7 @@ mod tests {
type Version = ();
type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = Balances;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/crowdfund.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ mod tests {
type Version = ();
type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = Balances;
}
parameter_types! {
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ mod tests {
type Version = ();
type ModuleToIndex = ();
type AccountData = balances::AccountData<u128>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = ();
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ mod tests {
type Version = ();
type ModuleToIndex = ();
type AccountData = balances::AccountData<u128>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = Balances;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ mod tests {
type Version = ();
type ModuleToIndex = ();
type AccountData = balances::AccountData<u64>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = Balances;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
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 }
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 }
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 }
Expand Down
6 changes: 1 addition & 5 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("kusama"),
impl_name: create_runtime_str!("parity-kusama"),
authoring_version: 2,
spec_version: 1054,
spec_version: 1055,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
};
Expand Down Expand Up @@ -138,10 +138,6 @@ impl system::Trait for Runtime {
type Version = Version;
type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (
Balances, Identity, ElectionsPhragmen, Society, Session, Staking, Recovery, Democracy,
Vesting, ImOnline
);
type OnNewAccount = ();
type OnKilledAccount = ();
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
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 }
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 }
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 }
Expand Down
2 changes: 1 addition & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl system::Trait for Runtime {
type Version = Version;
type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = ();
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
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 }
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 }
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 }
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl system::Trait for Runtime {
type Version = Version;
type ModuleToIndex = ModuleToIndex;
type AccountData = balances::AccountData<Balance>;
type MigrateAccount = (); type OnNewAccount = ();
type OnNewAccount = ();
type OnKilledAccount = ();
}

Expand Down

0 comments on commit e19d50b

Please sign in to comment.