Skip to content

Commit 87a5e3c

Browse files
committed
chore: appease clippy
1 parent edc86b1 commit 87a5e3c

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

pallets/subtensor/tests/migration.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ fn test_migrate_fix_pending_emissions() {
464464
let migration_name = "fix_pending_emission";
465465

466466
let null_account = U256::from(0); // The null account
467-
let rand_coldkeys = vec![U256::from(1), U256::from(2), U256::from(3), U256::from(4)];
467+
let rand_coldkeys = [U256::from(1), U256::from(2), U256::from(3), U256::from(4)];
468468

469469
let taostats_old_hotkey = "5Hddm3iBFD2GLT5ik7LZnT3XJUnRnN8PoeCFgGQgawUVKNm8";
470470
let taostats_new_hotkey = "5GKH9FPPnWSUoeeTJp19wVtd84XqFW4pyK2ijV2GsFbhTrP1";
@@ -479,17 +479,17 @@ fn test_migrate_fix_pending_emissions() {
479479
let datura_new_hk_account: AccountId = get_account_id_from_ss58(datura_new_hotkey);
480480

481481
// Setup the old Datura hotkey with a pending emission
482-
PendingdHotkeyEmission::<Test>::insert(&datura_old_hk_account, 10_000);
482+
PendingdHotkeyEmission::<Test>::insert(datura_old_hk_account, 10_000);
483483
// Setup the NEW Datura hotkey with a pending emission
484-
PendingdHotkeyEmission::<Test>::insert(&datura_new_hk_account, 123_456_789);
484+
PendingdHotkeyEmission::<Test>::insert(datura_new_hk_account, 123_456_789);
485485
let expected_datura_new_hk_pending_emission: u64 = 123_456_789 + 10_000;
486486

487487
// Setup the old TaoStats hotkey with a pending emission
488-
PendingdHotkeyEmission::<Test>::insert(&taostats_old_hk_account, 987_654);
488+
PendingdHotkeyEmission::<Test>::insert(taostats_old_hk_account, 987_654);
489489
// Setup the new TaoStats hotkey with a pending emission
490-
PendingdHotkeyEmission::<Test>::insert(&taostats_new_hk_account, 100_000);
490+
PendingdHotkeyEmission::<Test>::insert(taostats_new_hk_account, 100_000);
491491
// Setup the old TaoStats hotkey with a null-key stake entry
492-
Stake::<Test>::insert(&taostats_old_hk_account, &null_account, 123_456_789);
492+
Stake::<Test>::insert(taostats_old_hk_account, null_account, 123_456_789);
493493
let expected_taostats_new_hk_pending_emission: u64 = 987_654 + 100_000 + 123_456_789;
494494

495495
// Run migration

pallets/subtensor/tests/swap_coldkey.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,17 +1660,17 @@ fn test_coldkey_swap_last_add_stake_increase() {
16601660
100_000
16611661
));
16621662
// Check LastAddStakeIncrease
1663-
assert_eq!(LastAddStakeIncrease::<Test>::get(&hotkey, &old_coldkey), 10); // Just added stake
1663+
assert_eq!(LastAddStakeIncrease::<Test>::get(hotkey, old_coldkey), 10); // Just added stake
16641664

16651665
// Check the same for the new coldkey
1666-
assert_eq!(LastAddStakeIncrease::<Test>::get(&hotkey, &new_coldkey), 0); // No stake added ever
1666+
assert_eq!(LastAddStakeIncrease::<Test>::get(hotkey, new_coldkey), 0); // No stake added ever
16671667

16681668
// Perform the coldkey swap
16691669
assert_ok!(SubtensorModule::do_swap_coldkey(&old_coldkey, &new_coldkey));
16701670

16711671
// Check the LastAddStakeIncrease for the hotkey
1672-
assert_eq!(LastAddStakeIncrease::<Test>::get(&hotkey, &new_coldkey), 10); // Matches the old coldkey
1673-
assert_eq!(LastAddStakeIncrease::<Test>::get(&hotkey, &old_coldkey), 0);
1672+
assert_eq!(LastAddStakeIncrease::<Test>::get(hotkey, new_coldkey), 10); // Matches the old coldkey
1673+
assert_eq!(LastAddStakeIncrease::<Test>::get(hotkey, old_coldkey), 0);
16741674
// Should be reset to 0 (empty)
16751675
});
16761676
}

pallets/subtensor/tests/swap_hotkey.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,24 +1132,24 @@ fn test_swap_hotkey_with_pending_emissions() {
11321132
add_network(netuid, 0, 1);
11331133

11341134
// Set up pending emissions
1135-
PendingdHotkeyEmission::<Test>::insert(&old_hotkey, pending_emission);
1135+
PendingdHotkeyEmission::<Test>::insert(old_hotkey, pending_emission);
11361136
// Verify the pending emissions are set
11371137
assert_eq!(
1138-
PendingdHotkeyEmission::<Test>::get(&old_hotkey),
1138+
PendingdHotkeyEmission::<Test>::get(old_hotkey),
11391139
pending_emission
11401140
);
11411141
// Verify the new hotkey does not have any pending emissions
1142-
assert!(!PendingdHotkeyEmission::<Test>::contains_key(&new_hotkey));
1142+
assert!(!PendingdHotkeyEmission::<Test>::contains_key(new_hotkey));
11431143

11441144
// Perform the swap
11451145
SubtensorModule::perform_hotkey_swap(&old_hotkey, &new_hotkey, &coldkey, &mut weight);
11461146

11471147
// Verify the pending emissions are transferred
11481148
assert_eq!(
1149-
PendingdHotkeyEmission::<Test>::get(&new_hotkey),
1149+
PendingdHotkeyEmission::<Test>::get(new_hotkey),
11501150
pending_emission
11511151
);
1152-
assert!(!PendingdHotkeyEmission::<Test>::contains_key(&old_hotkey));
1152+
assert!(!PendingdHotkeyEmission::<Test>::contains_key(old_hotkey));
11531153
});
11541154
}
11551155

@@ -1160,7 +1160,7 @@ fn test_swap_hotkeys_last_add_stake_increase() {
11601160
let old_hotkey = U256::from(1);
11611161
let new_hotkey = U256::from(2);
11621162
let coldkey = U256::from(3);
1163-
let new_coldkeys = vec![U256::from(4), U256::from(5)];
1163+
let new_coldkeys = [U256::from(4), U256::from(5)];
11641164
let netuid = 0u16;
11651165
let mut weight = Weight::zero();
11661166

@@ -1171,10 +1171,10 @@ fn test_swap_hotkeys_last_add_stake_increase() {
11711171

11721172
// Setup LastAddStakeIncrease map
11731173
for new_coldkey in new_coldkeys.iter() {
1174-
LastAddStakeIncrease::<Test>::insert(&old_hotkey, &new_coldkey, 100);
1174+
LastAddStakeIncrease::<Test>::insert(old_hotkey, new_coldkey, 100);
11751175
}
11761176
// Verify the LastAddStakeIncrease map is empty for the new hotkey
1177-
assert!(LastAddStakeIncrease::<Test>::iter_prefix(&new_hotkey)
1177+
assert!(LastAddStakeIncrease::<Test>::iter_prefix(new_hotkey)
11781178
.next()
11791179
.is_none());
11801180

@@ -1184,12 +1184,12 @@ fn test_swap_hotkeys_last_add_stake_increase() {
11841184
// Verify the LastAddStakeIncrease map is transferred
11851185
for new_coldkey in new_coldkeys.iter() {
11861186
assert_eq!(
1187-
LastAddStakeIncrease::<Test>::get(&new_hotkey, &new_coldkey),
1187+
LastAddStakeIncrease::<Test>::get(new_hotkey, new_coldkey),
11881188
100
11891189
);
11901190
assert!(!LastAddStakeIncrease::<Test>::contains_key(
1191-
&old_hotkey,
1192-
&new_coldkey
1191+
old_hotkey,
1192+
new_coldkey
11931193
));
11941194
}
11951195
});

0 commit comments

Comments
 (0)