Skip to content

Commit

Permalink
chore: turn reg off for netuid that was on and assert no new emissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Dare committed May 27, 2024
1 parent e5708f0 commit 848a6ee
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pallets/subtensor/tests/block_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -868,15 +868,24 @@ fn test_emission_based_on_registration_status() {
.len(),
n as usize
);

// drain the emission tuples for the subnet with registration on
SubtensorModule::drain_emission(next_block as u64);
// Turn on registration for the subnet with registration off
SubtensorModule::set_network_registration_allowed(netuid_off, true);
SubtensorModule::set_network_registration_allowed(netuid_on, false);

// 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());
log::info!(
"Emissions for netuid with registration on: {:?}",
SubtensorModule::get_loaded_emission_tuples(netuid_on)
);
assert!(SubtensorModule::get_loaded_emission_tuples(netuid_on).is_none());
assert_eq!(
SubtensorModule::get_loaded_emission_tuples(netuid_off)
.unwrap()
Expand Down

0 comments on commit 848a6ee

Please sign in to comment.