File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
pallets/subtensor/src/staking
primitives/share-pool/src Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -553,7 +553,7 @@ impl<T: Config> Pallet<T> {
553
553
hotkey : & T :: AccountId ,
554
554
netuid : u16 ,
555
555
amount : u64 ,
556
- ) -> Result < ( ) , ( ) > {
556
+ ) -> bool {
557
557
let mut alpha_share_pool = Self :: get_alpha_share_pool ( hotkey. clone ( ) , netuid) ;
558
558
alpha_share_pool. sim_update_value_for_one ( amount as i64 )
559
559
}
@@ -895,9 +895,9 @@ impl<T: Config> Pallet<T> {
895
895
let try_stake_result = Self :: try_increase_stake_for_hotkey_and_coldkey_on_subnet (
896
896
hotkey,
897
897
netuid,
898
- expected_alpha. unwrap ( ) ,
898
+ expected_alpha. unwrap_or ( 0 ) ,
899
899
) ;
900
- ensure ! ( try_stake_result. is_ok ( ) , Error :: <T >:: InsufficientLiquidity ) ;
900
+ ensure ! ( try_stake_result, Error :: <T >:: InsufficientLiquidity ) ;
901
901
902
902
Ok ( ( ) )
903
903
}
@@ -1019,7 +1019,7 @@ impl<T: Config> Pallet<T> {
1019
1019
destination_netuid,
1020
1020
expected_alpha,
1021
1021
) ;
1022
- ensure ! ( try_stake_result. is_ok ( ) , Error :: <T >:: InsufficientLiquidity ) ;
1022
+ ensure ! ( try_stake_result, Error :: <T >:: InsufficientLiquidity ) ;
1023
1023
1024
1024
if check_transfer_toggle {
1025
1025
// Ensure transfer is toggled.
Original file line number Diff line number Diff line change @@ -75,13 +75,13 @@ where
75
75
} ) ;
76
76
}
77
77
78
- pub fn sim_update_value_for_one ( & mut self , update : i64 ) -> Result < ( ) , ( ) > {
78
+ pub fn sim_update_value_for_one ( & mut self , update : i64 ) -> bool {
79
79
let shared_value: U64F64 = self . state_ops . get_shared_value ( ) ;
80
80
let denominator: U64F64 = self . state_ops . get_denominator ( ) ;
81
81
82
82
// Then, update this key's share
83
83
if denominator == 0 {
84
- Ok ( ( ) )
84
+ true
85
85
} else {
86
86
// There are already keys in the pool, set or update this key
87
87
let value_per_share: I64F64 = I64F64 :: saturating_from_num (
95
95
. unwrap_or ( I64F64 :: saturating_from_num ( 0 ) ) ;
96
96
97
97
if shares_per_update != 0 {
98
- Ok ( ( ) )
98
+ true
99
99
} else {
100
- Err ( ( ) )
100
+ false
101
101
}
102
102
}
103
103
}
You can’t perform that action at this time.
0 commit comments