Skip to content

Commit f08bc1e

Browse files
committed
fix unit tests
1 parent ae25b5f commit f08bc1e

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pallets/subtensor/src/tests/children.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2861,6 +2861,7 @@ fn test_childkey_take_drain() {
28612861

28622862
// Add network, register hotkeys, and setup network parameters
28632863
add_network(netuid, subnet_tempo, 0);
2864+
SubtensorModule::set_ck_burn(0);
28642865
mock::setup_reserves(netuid, (stake * 10_000).into(), (stake * 10_000).into());
28652866
register_ok_neuron(netuid, child_hotkey, child_coldkey, 0);
28662867
register_ok_neuron(netuid, parent_hotkey, parent_coldkey, 1);
@@ -2980,6 +2981,7 @@ fn test_parent_child_chain_emission() {
29802981
let subnet_owner_coldkey = U256::from(1001);
29812982
let subnet_owner_hotkey = U256::from(1002);
29822983
let netuid = add_dynamic_network(&subnet_owner_hotkey, &subnet_owner_coldkey);
2984+
SubtensorModule::set_ck_burn(0);
29832985
Tempo::<Test>::insert(netuid, 1);
29842986

29852987
// Setup large LPs to prevent slippage
@@ -3192,6 +3194,7 @@ fn test_parent_child_chain_epoch() {
31923194
new_test_ext(1).execute_with(|| {
31933195
let netuid = NetUid::from(1);
31943196
add_network(netuid, 1, 0);
3197+
SubtensorModule::set_ck_burn(0);
31953198
// Set owner cut to 0
31963199
SubtensorModule::set_subnet_owner_cut(0_u16);
31973200

@@ -3336,6 +3339,7 @@ fn test_dividend_distribution_with_children() {
33363339
new_test_ext(1).execute_with(|| {
33373340
let netuid = NetUid::from(1);
33383341
add_network(netuid, 1, 0);
3342+
SubtensorModule::set_ck_burn(0);
33393343
mock::setup_reserves(
33403344
netuid,
33413345
1_000_000_000_000_000.into(),
@@ -3570,6 +3574,7 @@ fn test_dividend_distribution_with_children() {
35703574
fn test_dynamic_parent_child_relationships() {
35713575
new_test_ext(1).execute_with(|| {
35723576
let netuid = NetUid::from(1);
3577+
SubtensorModule::set_ck_burn(0);
35733578
add_network_disable_commit_reveal(netuid, 1, 0);
35743579

35753580
// Define hotkeys and coldkeys

pallets/subtensor/src/tests/coinbase.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,7 @@ fn test_drain_alpha_childkey_parentkey() {
10631063
new_test_ext(1).execute_with(|| {
10641064
let netuid = NetUid::from(1);
10651065
add_network(netuid, 1, 0);
1066+
SubtensorModule::set_ck_burn(0);
10661067
let parent = U256::from(1);
10671068
let child = U256::from(2);
10681069
let coldkey = U256::from(3);
@@ -1238,6 +1239,7 @@ fn test_get_root_children_drain() {
12381239
let alpha = NetUid::from(1);
12391240
add_network(NetUid::ROOT, 1, 0);
12401241
add_network(alpha, 1, 0);
1242+
SubtensorModule::set_ck_burn(0);
12411243
// Set TAO weight to 1.
12421244
SubtensorModule::set_tao_weight(u64::MAX); // Set TAO weight to 1.
12431245
// Create keys.
@@ -1399,6 +1401,7 @@ fn test_get_root_children_drain_half_proportion() {
13991401
let alpha = NetUid::from(1);
14001402
add_network(NetUid::ROOT, 1, 0);
14011403
add_network(alpha, 1, 0);
1404+
SubtensorModule::set_ck_burn(0);
14021405
// Set TAO weight to 1.
14031406
SubtensorModule::set_tao_weight(u64::MAX); // Set TAO weight to 1.
14041407
// Create keys.
@@ -1576,6 +1579,7 @@ fn test_get_root_children_drain_with_half_take() {
15761579
add_network(alpha, 1, 0);
15771580
// Set TAO weight to 1.
15781581
SubtensorModule::set_tao_weight(u64::MAX); // Set TAO weight to 1.
1582+
SubtensorModule::set_ck_burn(0);
15791583
// Create keys.
15801584
let cold_alice = U256::from(0);
15811585
let cold_bob = U256::from(1);

0 commit comments

Comments
 (0)