Skip to content

Commit 0aa2055

Browse files
committed
cargo fmt
1 parent 3b8fcef commit 0aa2055

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

pallets/subtensor/src/migrations/migrate_fix_staking_hot_keys.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ pub fn migrate_fix_staking_hot_keys<T: Config>() -> Weight {
2727
continue;
2828
}
2929

30-
let staking_hotkeys = cache.entry(coldkey.clone())
31-
.or_insert_with(|| {
32-
storage_reads = storage_reads.saturating_add(1);
33-
StakingHotkeys::<T>::get(&coldkey)
34-
});
30+
let staking_hotkeys = cache.entry(coldkey.clone()).or_insert_with(|| {
31+
storage_reads = storage_reads.saturating_add(1);
32+
StakingHotkeys::<T>::get(&coldkey)
33+
});
3534

3635
if !staking_hotkeys.contains(&hotkey) {
3736
staking_hotkeys.push(hotkey.clone());
@@ -52,4 +51,4 @@ pub fn migrate_fix_staking_hot_keys<T: Config>() -> Weight {
5251
);
5352

5453
weight
55-
}
54+
}

pallets/subtensor/src/migrations/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pub mod migrate_fix_childkeys;
1919
pub mod migrate_fix_is_network_member;
2020
pub mod migrate_fix_root_subnet_tao;
2121
pub mod migrate_fix_root_tao_and_alpha_in;
22+
pub mod migrate_fix_staking_hot_keys;
2223
pub mod migrate_init_tao_flow;
2324
pub mod migrate_init_total_issuance;
2425
pub mod migrate_kappa_map_to_default;
@@ -58,7 +59,6 @@ pub mod migrate_to_v1_separate_emission;
5859
pub mod migrate_to_v2_fixed_total_stake;
5960
pub mod migrate_transfer_ownership_to_foundation;
6061
pub mod migrate_upgrade_revealed_commitments;
61-
pub mod migrate_fix_staking_hot_keys;
6262

6363
pub(crate) fn migrate_storage<T: Config>(
6464
migration_name: &'static str,

pallets/subtensor/src/tests/migration.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,13 +1150,12 @@ fn test_migrate_fix_staking_hot_keys() {
11501150

11511151
// Add some data
11521152
Alpha::<Test>::insert(
1153-
(U256::from(1),
1154-
U256::from(2),
1155-
NetUid::ROOT),
1156-
U64F64::from(1_u64)
1153+
(U256::from(1), U256::from(2), NetUid::ROOT),
1154+
U64F64::from(1_u64),
11571155
);
11581156
// Run migration
1159-
let weight = migrations::migrate_fix_staking_hot_keys::migrate_fix_staking_hot_keys::<Test>();
1157+
let weight =
1158+
migrations::migrate_fix_staking_hot_keys::migrate_fix_staking_hot_keys::<Test>();
11601159

11611160
assert!(
11621161
HasMigrationRun::<Test>::get(MIGRATION_NAME.to_vec()),
@@ -1174,7 +1173,6 @@ fn test_migrate_fix_staking_hot_keys() {
11741173
});
11751174
}
11761175

1177-
11781176
#[test]
11791177
fn test_migrate_fix_root_subnet_tao() {
11801178
new_test_ext(1).execute_with(|| {

0 commit comments

Comments
 (0)