File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,7 @@ impl<T: Config> Pallet<T> {
305305 #[ allow( clippy:: arithmetic_side_effects) ]
306306 pub fn calculate_pow_difficulty ( swap_attempts : u32 ) -> U256 {
307307 let base_difficulty: U256 = U256 :: from ( 10_000_000 ) ; // Base difficulty
308- base_difficulty * U256 :: from ( 2 ) . pow ( U256 :: from ( swap_attempts) )
308+ base_difficulty. saturating_mul ( U256 :: from ( 2 ) . pow ( U256 :: from ( swap_attempts) ) )
309309 }
310310
311311 /// Arbitrates coldkeys that are scheduled to be swapped on this block.
@@ -317,7 +317,7 @@ impl<T: Config> Pallet<T> {
317317 /// # Returns
318318 ///
319319 /// * `Weight` - The total weight consumed by this operation
320- pub fn swap_coldkeys_this_block ( weight_limit : & Weight ) -> Result < Weight , & ' static str > {
320+ pub fn swap_coldkeys_this_block ( _weight_limit : & Weight ) -> Result < Weight , & ' static str > {
321321 let mut weight_used = frame_support:: weights:: Weight :: from_parts ( 0 , 0 ) ;
322322
323323 let current_block: u64 = Self :: get_current_block_as_u64 ( ) ;
Original file line number Diff line number Diff line change @@ -3638,16 +3638,13 @@ fn test_arbitrated_coldkey_swap_existing_destination() {
36383638 let ( work3, nonce3) = generate_valid_pow ( & current_coldkey, current_block, difficulty3) ;
36393639
36403640 // Attempt to schedule a third swap
3641- assert_noop ! (
3642- SubtensorModule :: do_schedule_coldkey_swap(
3643- & current_coldkey. clone( ) ,
3644- & third_coldkey,
3645- work3. to_fixed_bytes( ) . to_vec( ) ,
3646- current_block,
3647- nonce3
3648- ) ,
3649- Error :: <Test >:: ColdkeyIsInArbitration
3650- ) ;
3641+ assert_ok ! ( SubtensorModule :: do_schedule_coldkey_swap(
3642+ & current_coldkey. clone( ) ,
3643+ & third_coldkey,
3644+ work3. to_fixed_bytes( ) . to_vec( ) ,
3645+ current_block,
3646+ nonce3
3647+ ) ) ;
36513648 } ) ;
36523649}
36533650
You can’t perform that action at this time.
0 commit comments