Skip to content

Commit 6418911

Browse files
committed
fix args for em distr in tests
1 parent abef5e0 commit 6418911

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

pallets/subtensor/src/tests/claim_root.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn test_claim_root_with_drain_emissions() {
7575
SubtensorModule::distribute_emission(
7676
netuid,
7777
AlphaCurrency::ZERO,
78-
pending_root_alpha.into(),
78+
AlphaCurrency::ZERO,
7979
pending_root_alpha.into(),
8080
AlphaCurrency::ZERO,
8181
);
@@ -144,7 +144,7 @@ fn test_claim_root_with_drain_emissions() {
144144
SubtensorModule::distribute_emission(
145145
netuid,
146146
AlphaCurrency::ZERO,
147-
pending_root_alpha.into(),
147+
AlphaCurrency::ZERO,
148148
pending_root_alpha.into(),
149149
AlphaCurrency::ZERO,
150150
);
@@ -246,7 +246,7 @@ fn test_claim_root_adding_stake_proportionally_for_two_stakers() {
246246
SubtensorModule::distribute_emission(
247247
netuid,
248248
AlphaCurrency::ZERO,
249-
pending_root_alpha.into(),
249+
AlphaCurrency::ZERO,
250250
pending_root_alpha.into(),
251251
AlphaCurrency::ZERO,
252252
);
@@ -348,7 +348,7 @@ fn test_claim_root_adding_stake_disproportionally_for_two_stakers() {
348348
SubtensorModule::distribute_emission(
349349
netuid,
350350
AlphaCurrency::ZERO,
351-
pending_root_alpha.into(),
351+
AlphaCurrency::ZERO,
352352
pending_root_alpha.into(),
353353
AlphaCurrency::ZERO,
354354
);
@@ -440,7 +440,7 @@ fn test_claim_root_with_changed_stake() {
440440
SubtensorModule::distribute_emission(
441441
netuid,
442442
AlphaCurrency::ZERO,
443-
pending_root_alpha.into(),
443+
AlphaCurrency::ZERO,
444444
pending_root_alpha.into(),
445445
AlphaCurrency::ZERO,
446446
);
@@ -493,7 +493,7 @@ fn test_claim_root_with_changed_stake() {
493493
SubtensorModule::distribute_emission(
494494
netuid,
495495
AlphaCurrency::ZERO,
496-
pending_root_alpha.into(),
496+
AlphaCurrency::ZERO,
497497
pending_root_alpha.into(),
498498
AlphaCurrency::ZERO,
499499
);
@@ -547,7 +547,7 @@ fn test_claim_root_with_changed_stake() {
547547
SubtensorModule::distribute_emission(
548548
netuid,
549549
AlphaCurrency::ZERO,
550-
pending_root_alpha.into(),
550+
AlphaCurrency::ZERO,
551551
pending_root_alpha.into(),
552552
AlphaCurrency::ZERO,
553553
);
@@ -640,7 +640,7 @@ fn test_claim_root_with_drain_emissions_and_swap_claim_type() {
640640
SubtensorModule::distribute_emission(
641641
netuid,
642642
AlphaCurrency::ZERO,
643-
pending_root_alpha.into(),
643+
AlphaCurrency::ZERO,
644644
pending_root_alpha.into(),
645645
AlphaCurrency::ZERO,
646646
);
@@ -685,7 +685,7 @@ fn test_claim_root_with_drain_emissions_and_swap_claim_type() {
685685
SubtensorModule::distribute_emission(
686686
netuid,
687687
AlphaCurrency::ZERO,
688-
pending_root_alpha.into(),
688+
AlphaCurrency::ZERO,
689689
pending_root_alpha.into(),
690690
AlphaCurrency::ZERO,
691691
);
@@ -722,7 +722,7 @@ fn test_claim_root_with_drain_emissions_and_swap_claim_type() {
722722
SubtensorModule::distribute_emission(
723723
netuid,
724724
AlphaCurrency::ZERO,
725-
pending_root_alpha.into(),
725+
AlphaCurrency::ZERO,
726726
pending_root_alpha.into(),
727727
AlphaCurrency::ZERO,
728728
);
@@ -1148,7 +1148,7 @@ fn test_claim_root_with_swap_coldkey() {
11481148
SubtensorModule::distribute_emission(
11491149
netuid,
11501150
AlphaCurrency::ZERO,
1151-
pending_root_alpha.into(),
1151+
AlphaCurrency::ZERO,
11521152
pending_root_alpha.into(),
11531153
AlphaCurrency::ZERO,
11541154
);
@@ -1239,7 +1239,7 @@ fn test_claim_root_with_swap_hotkey() {
12391239
SubtensorModule::distribute_emission(
12401240
netuid,
12411241
AlphaCurrency::ZERO,
1242-
pending_root_alpha.into(),
1242+
AlphaCurrency::ZERO,
12431243
pending_root_alpha.into(),
12441244
AlphaCurrency::ZERO,
12451245
);
@@ -1356,7 +1356,7 @@ fn test_claim_root_on_network_deregistration() {
13561356
SubtensorModule::distribute_emission(
13571357
netuid,
13581358
AlphaCurrency::ZERO,
1359-
pending_root_alpha.into(),
1359+
AlphaCurrency::ZERO,
13601360
pending_root_alpha.into(),
13611361
AlphaCurrency::ZERO,
13621362
);
@@ -1497,7 +1497,7 @@ fn test_claim_root_with_unrelated_subnets() {
14971497
SubtensorModule::distribute_emission(
14981498
netuid,
14991499
AlphaCurrency::ZERO,
1500-
pending_root_alpha.into(),
1500+
AlphaCurrency::ZERO,
15011501
pending_root_alpha.into(),
15021502
AlphaCurrency::ZERO,
15031503
);

pallets/subtensor/src/tests/coinbase.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,9 @@ fn test_drain_base_with_subnet_with_single_staker_not_registered() {
747747
let pending_alpha = AlphaCurrency::from(1_000_000_000);
748748
SubtensorModule::distribute_emission(
749749
netuid,
750-
pending_alpha.into(),
750+
pending_alpha.saturating_div(2.into()).into(),
751+
pending_alpha.saturating_div(2.into()).into(),
751752
AlphaCurrency::ZERO,
752-
pending_alpha.into(),
753753
AlphaCurrency::ZERO,
754754
);
755755
let stake_after =
@@ -777,9 +777,9 @@ fn test_drain_base_with_subnet_with_single_staker_registered() {
777777
let pending_alpha = AlphaCurrency::from(1_000_000_000);
778778
SubtensorModule::distribute_emission(
779779
netuid,
780-
pending_alpha,
780+
pending_alpha.saturating_div(2.into()).into(),
781+
pending_alpha.saturating_div(2.into()).into(),
781782
AlphaCurrency::ZERO,
782-
pending_alpha,
783783
AlphaCurrency::ZERO,
784784
);
785785
let stake_after =
@@ -822,9 +822,9 @@ fn test_drain_base_with_subnet_with_single_staker_registered_root_weight() {
822822
assert_eq!(SubnetTAO::<Test>::get(NetUid::ROOT), TaoCurrency::ZERO);
823823
SubtensorModule::distribute_emission(
824824
netuid,
825-
pending_alpha,
825+
pending_alpha.saturating_div(2.into()).into(),
826+
pending_alpha.saturating_div(2.into()).into(),
826827
pending_root_alpha,
827-
pending_alpha.saturating_add(pending_root_alpha),
828828
AlphaCurrency::ZERO,
829829
);
830830
let stake_after =
@@ -870,9 +870,9 @@ fn test_drain_base_with_subnet_with_two_stakers_registered() {
870870
let pending_alpha = AlphaCurrency::from(1_000_000_000);
871871
SubtensorModule::distribute_emission(
872872
netuid,
873-
pending_alpha,
873+
pending_alpha.saturating_div(2.into()).into(),
874+
pending_alpha.saturating_div(2.into()).into(),
874875
AlphaCurrency::ZERO,
875-
pending_alpha,
876876
AlphaCurrency::ZERO,
877877
);
878878
let stake_after1 =
@@ -936,9 +936,9 @@ fn test_drain_base_with_subnet_with_two_stakers_registered_and_root() {
936936
assert_eq!(SubnetTAO::<Test>::get(NetUid::ROOT), TaoCurrency::ZERO);
937937
SubtensorModule::distribute_emission(
938938
netuid,
939-
pending_alpha,
939+
pending_alpha.saturating_div(2.into()).into(),
940+
pending_alpha.saturating_div(2.into()).into(),
940941
AlphaCurrency::ZERO,
941-
pending_alpha,
942942
AlphaCurrency::ZERO,
943943
);
944944
let stake_after1 =
@@ -1012,10 +1012,10 @@ fn test_drain_base_with_subnet_with_two_stakers_registered_and_root_different_am
10121012
assert_eq!(SubnetTAO::<Test>::get(NetUid::ROOT), TaoCurrency::ZERO);
10131013
SubtensorModule::distribute_emission(
10141014
netuid,
1015-
pending_alpha,
1015+
pending_alpha.saturating_div(2.into()).into(),
1016+
pending_alpha.saturating_div(2.into()).into(),
1017+
AlphaCurrency::ZERO,
10161018
AlphaCurrency::ZERO,
1017-
pending_alpha,
1018-
0.into(),
10191019
);
10201020
let stake_after1 =
10211021
SubtensorModule::get_stake_for_hotkey_and_coldkey_on_subnet(&hotkey1, &coldkey, netuid);
@@ -1093,9 +1093,9 @@ fn test_drain_base_with_subnet_with_two_stakers_registered_and_root_different_am
10931093
assert_eq!(SubnetTAO::<Test>::get(NetUid::ROOT), TaoCurrency::ZERO);
10941094
SubtensorModule::distribute_emission(
10951095
netuid,
1096-
pending_alpha,
1096+
pending_alpha.saturating_div(2.into()).into(),
1097+
pending_alpha.saturating_div(2.into()).into(),
10971098
AlphaCurrency::ZERO,
1098-
pending_alpha,
10991099
AlphaCurrency::ZERO,
11001100
);
11011101
let stake_after1 =
@@ -1155,9 +1155,9 @@ fn test_drain_alpha_childkey_parentkey() {
11551155
let pending_alpha = AlphaCurrency::from(1_000_000_000);
11561156
SubtensorModule::distribute_emission(
11571157
netuid,
1158-
pending_alpha,
1158+
pending_alpha.saturating_div(2.into()).into(),
1159+
pending_alpha.saturating_div(2.into()).into(),
11591160
AlphaCurrency::ZERO,
1160-
pending_alpha,
11611161
AlphaCurrency::ZERO,
11621162
);
11631163
let parent_stake_after = SubtensorModule::get_stake_for_hotkey_on_subnet(&parent, netuid);
@@ -1381,9 +1381,9 @@ fn test_get_root_children_drain() {
13811381
let pending_alpha = AlphaCurrency::from(1_000_000_000);
13821382
SubtensorModule::distribute_emission(
13831383
alpha,
1384-
pending_alpha,
1384+
pending_alpha.saturating_div(2.into()).into(),
1385+
pending_alpha.saturating_div(2.into()).into(),
13851386
AlphaCurrency::ZERO,
1386-
pending_alpha,
13871387
AlphaCurrency::ZERO,
13881388
);
13891389

@@ -1405,9 +1405,9 @@ fn test_get_root_children_drain() {
14051405
let pending_root1 = TaoCurrency::from(1_000_000_000);
14061406
SubtensorModule::distribute_emission(
14071407
alpha,
1408-
pending_alpha,
1408+
pending_alpha.saturating_div(2.into()).into(),
1409+
pending_alpha.saturating_div(2.into()).into(),
14091410
AlphaCurrency::ZERO,
1410-
pending_alpha,
14111411
AlphaCurrency::ZERO,
14121412
);
14131413

@@ -1429,9 +1429,9 @@ fn test_get_root_children_drain() {
14291429
let pending_root2 = TaoCurrency::from(1_000_000_000);
14301430
SubtensorModule::distribute_emission(
14311431
alpha,
1432-
pending_alpha,
1432+
pending_alpha.saturating_div(2.into()).into(),
1433+
pending_alpha.saturating_div(2.into()).into(),
14331434
AlphaCurrency::ZERO,
1434-
pending_alpha,
14351435
AlphaCurrency::ZERO,
14361436
);
14371437

@@ -1518,9 +1518,9 @@ fn test_get_root_children_drain_half_proportion() {
15181518
let pending_alpha = AlphaCurrency::from(1_000_000_000);
15191519
SubtensorModule::distribute_emission(
15201520
alpha,
1521-
pending_alpha,
1521+
pending_alpha.saturating_div(2.into()).into(),
1522+
pending_alpha.saturating_div(2.into()).into(),
15221523
AlphaCurrency::ZERO,
1523-
pending_alpha,
15241524
AlphaCurrency::ZERO,
15251525
);
15261526

@@ -1605,9 +1605,9 @@ fn test_get_root_children_drain_with_take() {
16051605
let pending_alpha = AlphaCurrency::from(1_000_000_000);
16061606
SubtensorModule::distribute_emission(
16071607
alpha,
1608-
pending_alpha,
1608+
pending_alpha.saturating_div(2.into()).into(),
1609+
pending_alpha.saturating_div(2.into()).into(),
16091610
AlphaCurrency::ZERO,
1610-
pending_alpha,
16111611
AlphaCurrency::ZERO,
16121612
);
16131613

@@ -1693,9 +1693,9 @@ fn test_get_root_children_drain_with_half_take() {
16931693
let pending_alpha = AlphaCurrency::from(1_000_000_000);
16941694
SubtensorModule::distribute_emission(
16951695
alpha,
1696-
pending_alpha,
1696+
pending_alpha.saturating_div(2.into()).into(),
1697+
pending_alpha.saturating_div(2.into()).into(),
16971698
AlphaCurrency::ZERO,
1698-
pending_alpha,
16991699
AlphaCurrency::ZERO,
17001700
);
17011701

@@ -2409,9 +2409,9 @@ fn test_distribute_emission_no_miners_all_drained() {
24092409
// Run drain pending without any miners.
24102410
SubtensorModule::distribute_emission(
24112411
netuid,
2412-
emission,
2412+
emission.saturating_div(2.into()).into(),
2413+
emission.saturating_div(2.into()).into(),
24132414
AlphaCurrency::ZERO,
2414-
emission,
24152415
AlphaCurrency::ZERO,
24162416
);
24172417

@@ -2776,9 +2776,9 @@ fn test_drain_alpha_childkey_parentkey_with_burn() {
27762776
let pending_alpha = AlphaCurrency::from(1_000_000_000);
27772777
SubtensorModule::distribute_emission(
27782778
netuid,
2779-
pending_alpha,
2779+
pending_alpha.saturating_div(2.into()).into(),
2780+
pending_alpha.saturating_div(2.into()).into(),
27802781
AlphaCurrency::ZERO,
2781-
pending_alpha,
27822782
AlphaCurrency::ZERO,
27832783
);
27842784
let parent_stake_after = SubtensorModule::get_stake_for_hotkey_on_subnet(&parent, netuid);

0 commit comments

Comments
 (0)