Skip to content

Commit

Permalink
test: turn reg on , gets emissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed May 27, 2024
1 parent fc61185 commit e5708f0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pallets/subtensor/tests/block_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,5 +868,20 @@ fn test_emission_based_on_registration_status() {
.len(),
n as usize
);
// Turn on registration for the subnet with registration off
SubtensorModule::set_network_registration_allowed(netuid_off, true);

// Generate emission at the next block
let next_block: u64 = block + 1;
SubtensorModule::generate_emission(next_block);

// Verify that emission tuples are now loaded for the subnet with registration turned on
assert!(SubtensorModule::get_loaded_emission_tuples(netuid_off).is_some());
assert_eq!(
SubtensorModule::get_loaded_emission_tuples(netuid_off)
.unwrap()
.len(),
n as usize
);
});
}

0 comments on commit e5708f0

Please sign in to comment.