Skip to content

Commit 00a652d

Browse files
committed
Remove unneeded argument on drain_emission
1 parent aa5e890 commit 00a652d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

pallets/subtensor/src/block_step.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<T: Config> Pallet<T> {
2121
}
2222
}
2323
// --- 3. Drains emission tuples ( hotkey, amount ).
24-
Self::drain_emission(block_number);
24+
Self::drain_emission();
2525
// --- 4. Generates emission tuples from epoch functions.
2626
Self::generate_emission(block_number);
2727
// Return ok.
@@ -89,7 +89,7 @@ impl<T: Config> Pallet<T> {
8989
/// Reads from the loaded emission storage which contains lists of pending emission tuples ( hotkey, amount )
9090
/// and distributes small chunks of them at a time.
9191
///
92-
pub fn drain_emission(_: u64) {
92+
pub fn drain_emission() {
9393
// --- 1. We iterate across each network.
9494
for (netuid, _) in <Tempo<T> as IterableStorageMap<u16, u16>>::iter() {
9595
let Some(tuples_to_drain) = Self::get_loaded_emission_tuples(netuid) else {

pallets/subtensor/tests/block_step.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ fn test_loaded_emission() {
4949

5050
// Try draining the emission tuples
5151
// None remaining because we are at epoch.
52-
let block: u64 = 8;
53-
SubtensorModule::drain_emission(block);
52+
SubtensorModule::drain_emission();
5453
assert!(SubtensorModule::get_loaded_emission_tuples(netuid).is_none());
5554

5655
// Generate more emission.
@@ -70,7 +69,7 @@ fn test_loaded_emission() {
7069
n_to_drain =
7170
SubtensorModule::tuples_to_drain_this_block(netuid, tempo, block, tuples.len());
7271
}
73-
SubtensorModule::drain_emission(block); // drain it with 9 more blocks to go
72+
SubtensorModule::drain_emission(); // drain it with 9 more blocks to go
7473
if let Some(tuples) = SubtensorModule::get_loaded_emission_tuples(netuid) {
7574
assert_eq!(tuples.len(), n_remaining - n_to_drain);
7675
}
@@ -872,7 +871,7 @@ fn test_emission_based_on_registration_status() {
872871

873872
let block: u64 = 0;
874873
// drain the emission tuples for the subnet with registration on
875-
SubtensorModule::drain_emission(block);
874+
SubtensorModule::drain_emission();
876875
// Turn on registration for the subnet with registration off
877876
SubtensorModule::set_network_registration_allowed(netuid_off, true);
878877
SubtensorModule::set_network_registration_allowed(netuid_on, false);

0 commit comments

Comments
 (0)