Skip to content

Commit 28ba654

Browse files
unconstunconst
authored andcommitted
clippy
1 parent bc19f08 commit 28ba654

File tree

8 files changed

+18
-14
lines changed

8 files changed

+18
-14
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,4 +372,4 @@ impl<T: Config> Pallet<T> {
372372
let remainder = block_plus_netuid.rem_euclid(tempo_plus_one);
373373
(tempo as u64).saturating_sub(remainder)
374374
}
375-
}
375+
}

pallets/subtensor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ pub mod pallet {
10731073
(H256, u64),
10741074
OptionQuery,
10751075
>;
1076-
1076+
10771077
/// ==================
10781078
/// ==== Genesis =====
10791079
/// ==================

pallets/subtensor/src/migrations/migrate_fix_total_coldkey_stake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::*;
2+
use alloc::string::String;
23
use frame_support::{
34
pallet_prelude::{Identity, OptionQuery},
45
storage_alias,
56
traits::{Get, StorageVersion},
67
weights::Weight,
78
};
8-
use alloc::string::String;
99
use sp_std::vec::Vec;
1010

1111
// TODO (camfairchild): TEST MIGRATION

pallets/subtensor/src/subnets/registration.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ impl<T: Config> Pallet<T> {
550550
// Copy the hotkey_bytes into the first half of full_bytes
551551
full_bytes[..32].copy_from_slice(hotkey_bytes);
552552
let keccak_256_seal_hash_vec: [u8; 32] = keccak_256(&full_bytes[..]);
553-
let hash_u64: u64 = u64::from_le_bytes(keccak_256_seal_hash_vec[0..8].try_into().unwrap_or_default());
553+
let hash_u64: u64 = u64::from_le_bytes(
554+
keccak_256_seal_hash_vec[0..8]
555+
.try_into()
556+
.unwrap_or_default(),
557+
);
554558
hash_u64
555559
}
556560

pallets/subtensor/src/swap/swap_coldkey.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::*;
22
use frame_support::weights::Weight;
3-
use sp_core::{Get};
3+
use sp_core::Get;
44

55
impl<T: Config> Pallet<T> {
66
/// Swaps the coldkey associated with a set of hotkeys from an old coldkey to a new coldkey.
@@ -225,4 +225,4 @@ impl<T: Config> Pallet<T> {
225225
// Return ok.
226226
Ok(())
227227
}
228-
}
228+
}

pallets/subtensor/tests/coinbase.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(unused, clippy::indexing_slicing, clippy::panic, clippy::unwrap_used)]
12
use crate::mock::*;
23
mod mock;
34
// use frame_support::{assert_err, assert_ok};

pallets/subtensor/tests/migration.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#![allow(clippy::unwrap_used)]
2-
1+
#![allow(unused, clippy::indexing_slicing, clippy::panic, clippy::unwrap_used)]
32
mod mock;
43
use frame_support::{assert_ok, weights::Weight};
54
use frame_system::Config;
@@ -283,7 +282,7 @@ fn test_migration_delete_subnet_21() {
283282
#[test]
284283
fn test_migrate_fix_total_coldkey_stake() {
285284
new_test_ext(1).execute_with(|| {
286-
let migration_name = "fix_total_coldkey_stake_v7";
285+
let _migration_name = "fix_total_coldkey_stake_v7";
287286
let coldkey = U256::from(0);
288287
TotalColdkeyStake::<Test>::insert(coldkey, 0);
289288
StakingHotkeys::<Test>::insert(coldkey, vec![U256::from(1), U256::from(2), U256::from(3)]);
@@ -299,7 +298,7 @@ fn test_migrate_fix_total_coldkey_stake() {
299298
#[test]
300299
fn test_migrate_fix_total_coldkey_stake_value_already_in_total() {
301300
new_test_ext(1).execute_with(|| {
302-
let migration_name = "fix_total_coldkey_stake_v7";
301+
let _migration_name = "fix_total_coldkey_stake_v7";
303302
let coldkey = U256::from(0);
304303
TotalColdkeyStake::<Test>::insert(coldkey, 100000000);
305304
StakingHotkeys::<Test>::insert(coldkey, vec![U256::from(1), U256::from(2), U256::from(3)]);
@@ -315,7 +314,7 @@ fn test_migrate_fix_total_coldkey_stake_value_already_in_total() {
315314
#[test]
316315
fn test_migrate_fix_total_coldkey_stake_no_entry() {
317316
new_test_ext(1).execute_with(|| {
318-
let migration_name = "fix_total_coldkey_stake_v7";
317+
let _migration_name = "fix_total_coldkey_stake_v7";
319318
let coldkey = U256::from(0);
320319
StakingHotkeys::<Test>::insert(coldkey, vec![U256::from(1), U256::from(2), U256::from(3)]);
321320
Stake::<Test>::insert(U256::from(1), U256::from(0), 10000);
@@ -330,7 +329,7 @@ fn test_migrate_fix_total_coldkey_stake_no_entry() {
330329
#[test]
331330
fn test_migrate_fix_total_coldkey_stake_no_entry_in_hotkeys() {
332331
new_test_ext(1).execute_with(|| {
333-
let migration_name = "fix_total_coldkey_stake_v7";
332+
let _migration_name = "fix_total_coldkey_stake_v7";
334333
let coldkey = U256::from(0);
335334
TotalColdkeyStake::<Test>::insert(coldkey, 100000000);
336335
StakingHotkeys::<Test>::insert(coldkey, vec![U256::from(1), U256::from(2), U256::from(3)]);
@@ -343,7 +342,7 @@ fn test_migrate_fix_total_coldkey_stake_no_entry_in_hotkeys() {
343342
#[test]
344343
fn test_migrate_fix_total_coldkey_stake_one_hotkey_stake_missing() {
345344
new_test_ext(1).execute_with(|| {
346-
let migration_name = "fix_total_coldkey_stake_v7";
345+
let _migration_name = "fix_total_coldkey_stake_v7";
347346
let coldkey = U256::from(0);
348347
TotalColdkeyStake::<Test>::insert(coldkey, 100000000);
349348
StakingHotkeys::<Test>::insert(coldkey, vec![U256::from(1), U256::from(2), U256::from(3)]);

pallets/subtensor/tests/swap_coldkey.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,4 +1285,4 @@ fn test_coldkey_delegations() {
12851285
assert_eq!(Stake::<Test>::get(delegate, new_coldkey), 100);
12861286
assert_eq!(Stake::<Test>::get(delegate, coldkey), 0);
12871287
});
1288-
}
1288+
}

0 commit comments

Comments
 (0)