Skip to content

Commit b008349

Browse files
committedNov 19, 2024
Reformat
1 parent d298baf commit b008349

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed
 

‎pallets/subtensor/src/rpc_info/neuron_info.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ impl<T: Config> Pallet<T> {
7979

8080
let axon_info = Self::get_axon_info(netuid, &hotkey.clone());
8181

82-
let prometheus_info = Self::get_prometheus_info(netuid, &hotkey.clone());
82+
let prometheus_info = Self::get_prometheus_info(netuid, &hotkey);
8383

84-
let coldkey = Owner::<T>::get(hotkey.clone()).clone();
84+
let coldkey = Owner::<T>::get(&hotkey).clone();
8585

8686
let active = Self::get_active_for_uid(netuid, uid);
8787
let rank = Self::get_rank_for_uid(netuid, uid);
@@ -119,8 +119,8 @@ impl<T: Config> Pallet<T> {
119119
let stake_weight: u64 = Self::get_stake_weight(netuid, uid) as u64;
120120
let stake: Vec<(T::AccountId, Compact<u64>)> = vec![(coldkey.clone(), stake_weight.into())];
121121
let neuron = NeuronInfo {
122-
hotkey: hotkey.clone(),
123-
coldkey: coldkey.clone(),
122+
hotkey,
123+
coldkey,
124124
uid: uid.into(),
125125
netuid: netuid.into(),
126126
active,
@@ -179,8 +179,8 @@ impl<T: Config> Pallet<T> {
179179
let stake: Vec<(T::AccountId, Compact<u64>)> = vec![(coldkey.clone(), stake_weight.into())];
180180

181181
let neuron = NeuronInfoLite {
182-
hotkey: hotkey.clone(),
183-
coldkey: coldkey.clone(),
182+
hotkey,
183+
coldkey,
184184
uid: uid.into(),
185185
netuid: netuid.into(),
186186
active,

‎pallets/subtensor/src/subnets/subnet.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ impl<T: Config> Pallet<T> {
191191
NetworkRegisteredAt::<T>::insert(netuid_to_register, current_block);
192192

193193
// --- 14. Init the pool by putting the lock as the initial alpha.
194-
// add the TAO to the pool.
194+
// add the TAO to the pool.
195195
SubnetTAO::<T>::insert(netuid_to_register, 1_000_000_000);
196-
// Set the alpha in based on the lock.
196+
// Set the alpha in based on the lock.
197197
SubnetAlphaIn::<T>::insert(netuid_to_register, 1_000_000_000);
198198
SubnetOwner::<T>::insert(netuid_to_register, coldkey.clone());
199199
SubnetOwnerHotkey::<T>::insert(netuid_to_register, hotkey.clone());

‎pallets/subtensor/tests/staking.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2498,6 +2498,7 @@ fn test_anneal_global_weight() {
24982498
// https://github.com/opentensor/subtensor/issues/925
24992499
// cargo test -p pallet-subtensor --test staking -- test_stake_weight_should_not_be_affected_by_zero_stakes --exact --nocapture
25002500
#[test]
2501+
#[allow(clippy::indexing_slicing)]
25012502
fn test_stake_weight_should_not_be_affected_by_zero_stakes() {
25022503
new_test_ext(1).execute_with(|| {
25032504
let registrar = AccountId::from(42); // SN Owner
@@ -2562,6 +2563,7 @@ fn test_stake_weight_should_not_be_affected_by_zero_stakes() {
25622563

25632564
// cargo test -p pallet-subtensor --test staking -- test_stake_weight_no_subnet_stake --exact --nocapture
25642565
#[test]
2566+
#[allow(clippy::indexing_slicing)]
25652567
fn test_stake_weight_no_subnet_stake() {
25662568
new_test_ext(1).execute_with(|| {
25672569
let registrar = AccountId::from(42); // SN Owner
@@ -2609,4 +2611,3 @@ fn test_stake_weight_no_subnet_stake() {
26092611
);
26102612
});
26112613
}
2612-

0 commit comments

Comments
 (0)