Skip to content

Commit a54ac00

Browse files
committed
fix benchmark
1 parent c415d8b commit a54ac00

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pallets/subtensor/src/benchmarks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,9 @@ mod pallet_benchmarks {
413413
let new_coldkey: T::AccountId = account("new_coldkey", 0, 0);
414414
let new_coldkey_hash: T::Hash = <T as frame_system::Config>::Hashing::hash_of(&new_coldkey);
415415

416+
let swap_cost = Subtensor::<T>::get_key_swap_cost();
417+
Subtensor::<T>::add_balance_to_coldkey_account(&coldkey, swap_cost.into());
418+
416419
#[extrinsic_call]
417420
_(RawOrigin::Signed(coldkey), new_coldkey_hash);
418421
}
@@ -429,9 +432,6 @@ mod pallet_benchmarks {
429432
ColdkeySwapAnnouncements::<T>::insert(&old_coldkey, (now, new_coldkey_hash));
430433
frame_system::Pallet::<T>::set_block_number(now + delay + 1u32.into());
431434

432-
let swap_cost = Subtensor::<T>::get_key_swap_cost();
433-
Subtensor::<T>::add_balance_to_coldkey_account(&old_coldkey, swap_cost.into());
434-
435435
let netuid = NetUid::from(1);
436436
Subtensor::<T>::init_new_network(netuid, 1);
437437
Subtensor::<T>::set_network_registration_allowed(netuid, true);

0 commit comments

Comments
 (0)