File tree Expand file tree Collapse file tree 5 files changed +12
-7
lines changed
Expand file tree Collapse file tree 5 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,9 @@ mod errors {
3838 NotEnoughStakeToSetChildkeys ,
3939 /// The caller is requesting adding more stake than there exists in the coldkey account.
4040 /// See: "[add_stake()]"
41- NotEnoughBalanceToStake ,
41+ /// The caller is requesting adding more stake than there exists in the coldkey account.
42+ /// See: "[add_stake()]"
43+ // NotEnoughBalanceToStake,
4244 /// The caller is trying to add stake, but for some reason the requested amount could not be
4345 /// withdrawn from the coldkey account.
4446 BalanceWithdrawalError ,
@@ -210,8 +212,10 @@ mod errors {
210212 ZeroMaxStakeAmount ,
211213 /// Invalid netuid duplication
212214 SameNetuid ,
213- /// The caller does not have enough balance for the operation.
214- InsufficientBalance ,
215+ /// The caller does not have enough balance to pay the fee.
216+ NotEnoughBalanceToPayFee ,
217+ /// The caller does not have enough balance to pay the stake.
218+ NotEnoughBalanceToPayStake ,
215219 /// Too frequent staking operations
216220 StakingOperationRateLimitExceeded ,
217221 /// Invalid lease beneficiary to register the leased network.
Original file line number Diff line number Diff line change @@ -971,7 +971,7 @@ impl<T: Config> Pallet<T> {
971971 // Ensure the callers coldkey has enough stake to perform the transaction.
972972 ensure ! (
973973 Self :: can_remove_balance_from_coldkey_account( coldkey, stake_to_be_added. into( ) ) ,
974- Error :: <T >:: NotEnoughBalanceToStake
974+ Error :: <T >:: NotEnoughBalanceToPayStake
975975 ) ;
976976
977977 // Ensure that the hotkey account exists this is only possible through registration.
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ impl<T: Config> Pallet<T> {
107107 let registration_cost = Self :: get_burn ( netuid) ;
108108 ensure ! (
109109 Self :: can_remove_balance_from_coldkey_account( & coldkey, registration_cost. into( ) ) ,
110- Error :: <T >:: NotEnoughBalanceToStake
110+ Error :: <T >:: NotEnoughBalanceToPayFee
111111 ) ;
112112
113113 // If the network account does not exist we will create it here.
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ fn test_add_stake_err_not_enough_belance() {
249249 netuid,
250250 stake,
251251 ) ,
252- Error :: <Test >:: NotEnoughBalanceToStake
252+ Error :: <Test >:: NotEnoughBalanceToPayStake
253253 ) ;
254254 } ) ;
255255}
Original file line number Diff line number Diff line change 5454 Err ( match err {
5555 Error :: < T > :: AmountTooLow => CustomTransactionError :: StakeAmountTooLow . into ( ) ,
5656 Error :: < T > :: SubnetNotExists => CustomTransactionError :: SubnetNotExists . into ( ) ,
57- Error :: < T > :: NotEnoughBalanceToStake => CustomTransactionError :: BalanceTooLow . into ( ) ,
57+ Error :: < T > :: NotEnoughBalanceToPayFee => CustomTransactionError :: BalanceTooLow . into ( ) ,
58+ Error :: < T > :: NotEnoughBalanceToPayStake => CustomTransactionError :: BalanceTooLow . into ( ) ,
5859 Error :: < T > :: HotKeyAccountNotExists => {
5960 CustomTransactionError :: HotkeyAccountDoesntExist . into ( )
6061 }
You can’t perform that action at this time.
0 commit comments