Skip to content

Commit f073f03

Browse files
Merge pull request #390 from cuteolaf/patch-1
update comments
2 parents 74f2f3b + e57b429 commit f073f03

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

pallets/subtensor/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ pub mod pallet {
13161316
// * 'take' (u16):
13171317
// - The new stake proportion that this hotkey takes from delegations.
13181318
// The new value can be between 0 and 11_796 and should be strictly
1319-
// lower than the previous value. It T is the new value (rational number),
1319+
// lower than the previous value. If T is the new value (rational number),
13201320
// the the parameter is calculated as [65535 * T]. For example, 1% would be
13211321
// [0.01 * 65535] = [655.35] = 655
13221322
//
@@ -1331,7 +1331,7 @@ pub mod pallet {
13311331
// * 'NonAssociatedColdKey':
13321332
// - The hotkey we are delegating is not owned by the calling coldkey.
13331333
//
1334-
// * 'InvalidTransaction':
1334+
// * 'InvalidTake':
13351335
// - The delegate is setting a take which is not lower than the previous.
13361336
//
13371337
#[pallet::call_index(65)]
@@ -1356,13 +1356,13 @@ pub mod pallet {
13561356
// * 'take' (u16):
13571357
// - The new stake proportion that this hotkey takes from delegations.
13581358
// The new value can be between 0 and 11_796 and should be strictly
1359-
// greater than the previous value. It T is the new value (rational number),
1359+
// greater than the previous value. If T is the new value (rational number),
13601360
// the the parameter is calculated as [65535 * T]. For example, 1% would be
13611361
// [0.01 * 65535] = [655.35] = 655
13621362
//
13631363
// # Event:
1364-
// * TakeDecreased;
1365-
// - On successfully setting a decreased take for this hotkey.
1364+
// * TakeIncreased;
1365+
// - On successfully setting a increased take for this hotkey.
13661366
//
13671367
// # Raises:
13681368
// * 'NotRegistered':
@@ -1371,8 +1371,8 @@ pub mod pallet {
13711371
// * 'NonAssociatedColdKey':
13721372
// - The hotkey we are delegating is not owned by the calling coldkey.
13731373
//
1374-
// * 'InvalidTransaction':
1375-
// - The delegate is setting a take which is not lower than the previous.
1374+
// * 'InvalidTake':
1375+
// - The delegate is setting a take which is not greater than the previous.
13761376
//
13771377
#[pallet::call_index(66)]
13781378
#[pallet::weight((0, DispatchClass::Normal, Pays::No))]

pallets/subtensor/src/staking.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ impl<T: Config> Pallet<T> {
117117
// * 'NonAssociatedColdKey':
118118
// - The hotkey we are delegating is not owned by the calling coldket.
119119
//
120+
// * 'InvalidTake':
121+
// - The delegate is setting a take which is not lower than the previous.
122+
//
120123
pub fn do_decrease_take(
121124
origin: T::RuntimeOrigin,
122125
hotkey: T::AccountId,
@@ -173,8 +176,8 @@ impl<T: Config> Pallet<T> {
173176
// - The stake proportion that this hotkey takes from delegations for subnet ID.
174177
//
175178
// # Event:
176-
// * TakeDecreased;
177-
// - On successfully setting a decreased take for this hotkey.
179+
// * TakeIncreased;
180+
// - On successfully setting a increased take for this hotkey.
178181
//
179182
// # Raises:
180183
// * 'NotRegistered':
@@ -186,6 +189,9 @@ impl<T: Config> Pallet<T> {
186189
// * 'TxRateLimitExceeded':
187190
// - Thrown if key has hit transaction rate limit
188191
//
192+
// * 'InvalidTake':
193+
// - The delegate is setting a take which is not greater than the previous.
194+
//
189195
pub fn do_increase_take(
190196
origin: T::RuntimeOrigin,
191197
hotkey: T::AccountId,

0 commit comments

Comments
 (0)