Skip to content

Commit

Permalink
Fixed test_registration_rate_limit_exceeded test
Browse files Browse the repository at this point in the history
  • Loading branch information
shibshib committed Apr 29, 2024
1 parent 981e6af commit 3e97cb2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pallets/subtensor/tests/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,12 @@ fn test_registration_rate_limit_exceeded() {
let coldkey_account_id = U256::from(667);
let who: <Test as frame_system::Config>::AccountId = hotkey_account_id;

let max_registrants = 1;
SubtensorModule::set_target_registrations_per_interval(netuid, max_registrants);
SubtensorModule::set_registrations_this_interval(netuid, 1);
let target_registrants = 1;
let max_registrants = target_registrants * 3; // Maximum is 3 times the target

SubtensorModule::set_target_registrations_per_interval(netuid, target_registrants);
// Set the current registrations to the maximum; should not be able to register more
SubtensorModule::set_registrations_this_interval(netuid, max_registrants);

let (nonce, work) = SubtensorModule::create_work_for_block_number(
netuid,
Expand Down

0 comments on commit 3e97cb2

Please sign in to comment.