Skip to content

Commit 848a6ee

Browse files
author
Samuel Dare
committed
chore: turn reg off for netuid that was on and assert no new emissions
1 parent e5708f0 commit 848a6ee

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pallets/subtensor/tests/block_step.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,15 +868,24 @@ fn test_emission_based_on_registration_status() {
868868
.len(),
869869
n as usize
870870
);
871+
872+
// drain the emission tuples for the subnet with registration on
873+
SubtensorModule::drain_emission(next_block as u64);
871874
// Turn on registration for the subnet with registration off
872875
SubtensorModule::set_network_registration_allowed(netuid_off, true);
876+
SubtensorModule::set_network_registration_allowed(netuid_on, false);
873877

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

878882
// Verify that emission tuples are now loaded for the subnet with registration turned on
879883
assert!(SubtensorModule::get_loaded_emission_tuples(netuid_off).is_some());
884+
log::info!(
885+
"Emissions for netuid with registration on: {:?}",
886+
SubtensorModule::get_loaded_emission_tuples(netuid_on)
887+
);
888+
assert!(SubtensorModule::get_loaded_emission_tuples(netuid_on).is_none());
880889
assert_eq!(
881890
SubtensorModule::get_loaded_emission_tuples(netuid_off)
882891
.unwrap()

0 commit comments

Comments
 (0)