Skip to content

Commit 6daad1e

Browse files
committed
fix clippy in test file
1 parent 8f8b92c commit 6daad1e

File tree

2 files changed

+3
-32
lines changed

2 files changed

+3
-32
lines changed

pallets/subtensor/tests/staking.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3839,7 +3839,7 @@ fn test_transfer_coldkey_in_arbitration() {
38393839

38403840
// Try to transfer balance
38413841
let call = RuntimeCall::Balances(BalancesCall::transfer_allow_death {
3842-
dest: recipient_account_id.into(),
3842+
dest: recipient_account_id,
38433843
value: 1000,
38443844
});
38453845

@@ -3937,7 +3937,7 @@ fn test_transfer_coldkey_not_in_arbitration() {
39373937
SubtensorModule::add_balance_to_coldkey_account(&coldkey_account_id, 60000);
39383938

39393939
let call = RuntimeCall::Balances(BalancesCall::transfer_allow_death {
3940-
dest: recipient_account_id.into(),
3940+
dest: recipient_account_id,
39413941
value: 1000,
39423942
});
39433943

@@ -3958,6 +3958,6 @@ fn generate_valid_pow(coldkey: &AccountId, block_number: u64, difficulty: u32) -
39583958
if SubtensorModule::hash_meets_difficulty(&work, difficulty.into()) {
39593959
return (work.as_bytes().to_vec(), nonce);
39603960
}
3961-
nonce += 1;
3961+
nonce = nonce.saturating_add(1);
39623962
}
39633963
}

pallets/subtensor/tests/swap.rs

-29
Original file line numberDiff line numberDiff line change
@@ -1253,35 +1253,6 @@ fn test_swap_stake_for_coldkey() {
12531253
});
12541254
}
12551255

1256-
#[test]
1257-
fn test_swap_owner_for_coldkey() {
1258-
new_test_ext(1).execute_with(|| {
1259-
let old_coldkey = U256::from(1);
1260-
let new_coldkey = U256::from(2);
1261-
let hotkey1 = U256::from(3);
1262-
let hotkey2 = U256::from(4);
1263-
let mut weight = Weight::zero();
1264-
1265-
// Initialize Owner for old_coldkey
1266-
Owner::<Test>::insert(hotkey1, old_coldkey);
1267-
Owner::<Test>::insert(hotkey2, old_coldkey);
1268-
1269-
// Initialize OwnedHotkeys map
1270-
OwnedHotkeys::<Test>::insert(old_coldkey, vec![hotkey1, hotkey2]);
1271-
1272-
// Perform the swap
1273-
SubtensorModule::swap_owner_for_coldkey(&old_coldkey, &new_coldkey, &mut weight);
1274-
1275-
// Verify the swap
1276-
assert_eq!(Owner::<Test>::get(hotkey1), new_coldkey);
1277-
assert_eq!(Owner::<Test>::get(hotkey2), new_coldkey);
1278-
1279-
// Verify weight update
1280-
let expected_weight = <Test as frame_system::Config>::DbWeight::get().reads_writes(1, 2);
1281-
assert_eq!(weight, expected_weight);
1282-
});
1283-
}
1284-
12851256
#[test]
12861257
fn test_swap_total_hotkey_coldkey_stakes_this_interval_for_coldkey() {
12871258
new_test_ext(1).execute_with(|| {

0 commit comments

Comments
 (0)