Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Jul 5, 2024
1 parent b761d37 commit 7641f15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallets/subtensor/src/coinbase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<T: Config> Pallet<T> {
);

// --- 4.3 Set last step counter.
Self::set_blocks_since_last_step(*netuid, 0);
Self::set_blocks_since_last_step(*netuid, current_block);
Self::set_last_mechanism_step_block(*netuid, current_block);

// --- 4.4 Distribute owner take.
Expand Down
6 changes: 3 additions & 3 deletions pallets/subtensor/tests/block_step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,16 +1765,16 @@ fn test_epoch_runs_when_registration_disabled() {
step_block(1); // Now block 2

// Verify blocks since last step was set
assert_eq!(SubtensorModule::get_blocks_since_last_step(netuid_off), 1);
assert_eq!(SubtensorModule::get_blocks_since_last_step(netuid_off), 0);

// Step to the next epoch block
let epoch_block: u16 = tempo;
step_block(epoch_block);
step_block(epoch_block); // Now block 3

// Verify blocks since last step was set, this indicates we ran the epoch
assert_eq!(
SubtensorModule::get_blocks_since_last_step(netuid_off),
0_u64
3_u64
);
assert!(SubtensorModule::get_loaded_emission_tuples(netuid_off).is_some());
});
Expand Down

0 comments on commit 7641f15

Please sign in to comment.