Skip to content

Commit fc63e2a

Browse files
Removed unused imports and hid unused variables for the aura, balances, collator_selection, dmp_queue, proxy, society, xcmp queue pallet verifier migrations. Removed unused imports and hid unused variables authorship, parachain_system, transaction_payment, vesting pallet migrations.
1 parent d7decbf commit fc63e2a

13 files changed

+27
-47
lines changed

runtime/src/migrations/aura_verifier.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade,
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
76
use sp_consensus_aura::Slot;
8-
use super::*;
97

108
#[cfg(feature = "try-runtime")]
119
use sp_runtime::TryRuntimeError;
@@ -30,7 +28,7 @@ impl OnRuntimeUpgrade for Migrate {
3028
}
3129

3230
#[cfg(feature = "try-runtime")]
33-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
31+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
3432
log::info!(target: TARGET, "In post upgrade");
3533
let authorities = Authorities::<Runtime>::get();
3634

runtime/src/migrations/authorship.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
use super::*;
21
use crate::*;
32
use frame_support::{
43
pallet_prelude::*,
5-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade
65
};
76

8-
#[cfg(feature = "try-runtime")]
9-
use sp_runtime::TryRuntimeError;
107

118
/// The log target.
129
const TARGET: &'static str = "runtime::authorship::migration";

runtime/src/migrations/balances_verifier.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
7-
use super::*;
86

97
#[cfg(feature = "try-runtime")]
108
use sp_runtime::TryRuntimeError;
@@ -21,7 +19,7 @@ impl OnRuntimeUpgrade for Migrate {
2119
}
2220

2321
#[cfg(feature = "try-runtime")]
24-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
22+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
2523
log::info!(target: TARGET, "In post upgrade");
2624

2725
let locks_count = pallet_balances::Locks::<Runtime>::iter_keys().count() as u32;

runtime/src/migrations/collator_selection_verifier.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade,
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
7-
use super::*;
86

97
#[cfg(feature = "try-runtime")]
108
use sp_runtime::TryRuntimeError;
@@ -21,7 +19,7 @@ impl OnRuntimeUpgrade for Migrate {
2119
}
2220

2321
#[cfg(feature = "try-runtime")]
24-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
22+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
2523
log::info!(target: TARGET, "In post upgrade");
2624

2725
let authored_blocks_count = pallet_collator_selection::LastAuthoredBlock::<Runtime>::iter_keys().count() as u32;

runtime/src/migrations/dmp_queue_verifier.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade,
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
7-
use super::*;
6+
87
use cumulus_pallet_dmp_queue::{ConfigData, PageIndexData};
98

109
#[cfg(feature = "try-runtime")]
@@ -28,7 +27,7 @@ impl OnRuntimeUpgrade for Migrate {
2827
}
2928

3029
#[cfg(feature = "try-runtime")]
31-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
30+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
3231
log::info!(target: TARGET, "In post upgrade");
3332

3433
log::info!(target: TARGET, "Configuration: {:?}", Configuration::<Runtime>::get());

runtime/src/migrations/identity_verifier.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use frame_support::{
33
pallet_prelude::*,
44
traits::{Currency, OnRuntimeUpgrade},
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
76
use pallet_identity::*;
87

98
#[cfg(feature = "try-runtime")]
@@ -54,7 +53,7 @@ impl OnRuntimeUpgrade for Migrate {
5453
}
5554

5655
#[cfg(feature = "try-runtime")]
57-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
56+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
5857
log::info!(target: TARGET, "In identity verifier post upgrade");
5958
let vesting_version = StorageVersion::get::<Vesting>();
6059
log::info!(

runtime/src/migrations/parachain_system.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
use super::*;
1+
22
use crate::*;
33
use cumulus_pallet_parachain_system::MessagingStateSnapshot;
44
use cumulus_primitives_core::{AbridgedHostConfiguration, PersistedValidationData};
55
use frame_support::{
66
pallet_prelude::*,
7-
traits::{Currency, OnRuntimeUpgrade},
7+
traits::OnRuntimeUpgrade,
88
};
9-
use frame_system::pallet_prelude::BlockNumberFor;
109
#[cfg(feature = "try-runtime")]
1110
use sp_runtime::TryRuntimeError;
1211

@@ -112,7 +111,7 @@ pub mod v1 {
112111
}
113112

114113
#[cfg(feature = "try-runtime")]
115-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
114+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
116115
log::info!(target: TARGET, "In post upgrade, should be able to decode host configuration with the new structure");
117116
let host_configuration = HostConfiguration::<Runtime>::get().unwrap();
118117
log::info!(" ");

runtime/src/migrations/proxy_verifier.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade,
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
7-
use super::*;
86

97
#[cfg(feature = "try-runtime")]
108
use sp_runtime::TryRuntimeError;
@@ -21,7 +19,7 @@ impl OnRuntimeUpgrade for Migrate {
2119
}
2220

2321
#[cfg(feature = "try-runtime")]
24-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
22+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
2523
log::info!(target: TARGET, "In post upgrade");
2624

2725
let proxies_count = pallet_proxy::Proxies::<Runtime>::iter_keys().count() as u32;

runtime/src/migrations/society_verifier.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
use crate::*;
22
use frame_support::{
33
pallet_prelude::*,
4-
traits::{Currency, OnRuntimeUpgrade},
4+
traits::OnRuntimeUpgrade,
55
};
6-
use frame_system::pallet_prelude::BlockNumberFor;
7-
use super::*;
86

97
#[cfg(feature = "try-runtime")]
108
use sp_runtime::TryRuntimeError;
@@ -21,7 +19,7 @@ impl OnRuntimeUpgrade for Migrate {
2119
}
2220

2321
#[cfg(feature = "try-runtime")]
24-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
22+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
2523
log::info!(target: TARGET, "In post upgrade");
2624

2725
let candidates_count = pallet_society::Candidates::<Runtime>::iter_keys().count() as u32;

runtime/src/migrations/system.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
use super::*;
21
use crate::*;
32
use frame_system::EventRecord;
43
use frame_support::{
54
pallet_prelude::*,
6-
traits::{Currency, OnRuntimeUpgrade},
5+
traits::OnRuntimeUpgrade,
76
};
8-
use frame_system::pallet_prelude::BlockNumberFor;
97
use frame_system::ConsumedWeight;
108
#[cfg(feature = "try-runtime")]
119
use sp_runtime::TryRuntimeError;
@@ -14,8 +12,8 @@ use sp_runtime::TryRuntimeError;
1412
const TARGET: &'static str = "runtime::system::migration";
1513

1614
pub mod v0 {
17-
use cumulus_primitives_core::relay_chain::AsyncBackingParams;
18-
use sp_runtime::traits::Saturating;
15+
// use cumulus_primitives_core::relay_chain::AsyncBackingParams;
16+
// use sp_runtime::traits::Saturating;
1917

2018
use super::*;
2119

@@ -95,7 +93,7 @@ pub mod v0 {
9593
}
9694

9795
#[cfg(feature = "try-runtime")]
98-
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
96+
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
9997
log::info!(target: TARGET, "In post upgrade");
10098
let num_account_keys = frame_system::Account::<Runtime>::iter_keys().count() as u32;
10199
let num_accounts = frame_system::Account::<Runtime>::iter_values().count() as u32;

0 commit comments

Comments
 (0)