Skip to content

Commit 9ba5e6d

Browse files
committed
add set_liquid_alpha_enabled
1 parent 6186d29 commit 9ba5e6d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pallets/subtensor/src/utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,4 +659,8 @@ impl<T: Config> Pallet<T> {
659659
pub fn set_alpha_low(netuid: u16, alpha_low: u16) {
660660
AlphaLow::<T>::insert(netuid, alpha_low);
661661
}
662+
663+
pub fn set_liquid_alpha_enabled(netuid: u16, enabled: bool) {
664+
LiquidAlphaOn::<T>::set(netuid, enabled);
665+
}
662666
}

pallets/subtensor/tests/epoch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@ fn test_bonds_with_liquid_alpha() {
12991299
}
13001300

13011301
// Enable Liquid Alpha
1302-
// LiquidAlphaOn::<Test>::put(true);
1302+
SubtensorModule::set_liquid_alpha_enabled(netuid, true);
13031303
SubtensorModule::set_alpha_high(netuid, 900);
13041304
SubtensorModule::set_alpha_low(netuid, 100);
13051305
// Run epoch with Liquid Alpha
@@ -1326,7 +1326,7 @@ fn test_bonds_with_liquid_alpha() {
13261326
W (permit): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []]
13271327
W (permit+diag): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []]
13281328
W (permit+diag+outdate): [[(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [(4, 16383), (5, 32767), (6, 49149), (7, 65535)], [], [], [], []]
1329-
W (mask+norm): [[(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []]
1329+
W (mask+norm): [[(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []]
13301330
R (before): [0, 0, 0, 0, 0.099997558, 0.2000012202, 0.2999926745, 0.4000085443]
13311331
C: [0, 0, 0, 0, 0.0999975584, 0.2000012207, 0.2999926754, 0.400008545]
13321332
W: [[(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [(4, 0.0999975584), (5, 0.2000012207), (6, 0.2999926754), (7, 0.400008545)], [], [], [], []]

0 commit comments

Comments
 (0)