Skip to content

Commit 5e8b299

Browse files
Update root claim defaults.
1 parent ca55c51 commit 5e8b299

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

pallets/subtensor/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,9 @@ pub mod pallet {
330330
/// Enum for the per-coldkey root claim setting.
331331
pub enum RootClaimTypeEnum {
332332
/// Swap any alpha emission for TAO.
333+
#[default]
333334
Swap,
334335
/// Keep all alpha emission.
335-
#[default]
336336
Keep,
337337
/// Keep all alpha emission for specified subnets.
338338
KeepSubnets {
@@ -361,7 +361,7 @@ pub mod pallet {
361361
/// Default value for delegate claim type storage
362362
#[pallet::type_value]
363363
pub fn DefaultValidatorClaimType<T: Config>() -> RootClaimTypeEnum {
364-
RootClaimTypeEnum::Keep
364+
RootClaimTypeEnum::Swap
365365
}
366366

367367
/// Default number of root claims per claim call.

pallets/subtensor/src/tests/claim_root.rs

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ fn test_claim_root_with_set_validator_claim_type() {
15851585
// Default check
15861586
assert_eq!(
15871587
ValidatorClaimType::<Test>::get(hotkey, netuid),
1588-
RootClaimTypeEnum::Keep
1588+
RootClaimTypeEnum::Swap
15891589
);
15901590

15911591
// Set new type
@@ -2206,10 +2206,26 @@ fn test_claim_root_calculate_tao_outflow() {
22062206
}
22072207

22082208
#[test]
2209-
fn test_claim_root_default_mode_keep() {
2209+
fn test_claim_root_default_mode() {
22102210
new_test_ext(1).execute_with(|| {
22112211
let coldkey = U256::from(1003);
22122212

2213-
assert_eq!(RootClaimType::<Test>::get(coldkey), RootClaimTypeEnum::Keep);
2213+
assert_eq!(
2214+
RootClaimType::<Test>::get(coldkey),
2215+
RootClaimTypeEnum::Delegated
2216+
);
2217+
});
2218+
}
2219+
2220+
#[test]
2221+
fn test_claim_root_default_validator_mode() {
2222+
new_test_ext(1).execute_with(|| {
2223+
let coldkey = U256::from(1003);
2224+
let netuid = NetUid::from(100u16);
2225+
2226+
assert_eq!(
2227+
ValidatorClaimType::<Test>::get(coldkey, netuid),
2228+
RootClaimTypeEnum::Swap
2229+
);
22142230
});
22152231
}

0 commit comments

Comments
 (0)