From 8362b2a3bff0ca8aae76b993de6ac6222930697f Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Fri, 3 May 2024 06:17:12 -0700 Subject: [PATCH 1/2] update comments --- pallets/subtensor/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 8d424782b..299a0fd78 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1376,7 +1376,7 @@ pub mod pallet { // * 'take' (u16): // - The new stake proportion that this hotkey takes from delegations. // The new value can be between 0 and 11_796 and should be strictly - // lower than the previous value. It T is the new value (rational number), + // lower than the previous value. If T is the new value (rational number), // the the parameter is calculated as [65535 * T]. For example, 1% would be // [0.01 * 65535] = [655.35] = 655 // @@ -1416,13 +1416,13 @@ pub mod pallet { // * 'take' (u16): // - The new stake proportion that this hotkey takes from delegations. // The new value can be between 0 and 11_796 and should be strictly - // greater than the previous value. It T is the new value (rational number), + // greater than the previous value. If T is the new value (rational number), // the the parameter is calculated as [65535 * T]. For example, 1% would be // [0.01 * 65535] = [655.35] = 655 // // # Event: - // * TakeDecreased; - // - On successfully setting a decreased take for this hotkey. + // * TakeIncreased; + // - On successfully setting a increased take for this hotkey. // // # Raises: // * 'NotRegistered': @@ -1432,7 +1432,7 @@ pub mod pallet { // - The hotkey we are delegating is not owned by the calling coldkey. // // * 'InvalidTransaction': - // - The delegate is setting a take which is not lower than the previous. + // - The delegate is setting a take which is not greater than the previous. // #[pallet::call_index(66)] #[pallet::weight((0, DispatchClass::Normal, Pays::No))] From e57b429f6e820efd267da762c5e7fcb8e3d637e2 Mon Sep 17 00:00:00 2001 From: cuteolaf Date: Fri, 3 May 2024 13:29:58 +0000 Subject: [PATCH 2/2] update comments --- pallets/subtensor/src/lib.rs | 4 ++-- pallets/subtensor/src/staking.rs | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pallets/subtensor/src/lib.rs b/pallets/subtensor/src/lib.rs index 299a0fd78..6a607beec 100644 --- a/pallets/subtensor/src/lib.rs +++ b/pallets/subtensor/src/lib.rs @@ -1391,7 +1391,7 @@ pub mod pallet { // * 'NonAssociatedColdKey': // - The hotkey we are delegating is not owned by the calling coldkey. // - // * 'InvalidTransaction': + // * 'InvalidTake': // - The delegate is setting a take which is not lower than the previous. // #[pallet::call_index(65)] @@ -1431,7 +1431,7 @@ pub mod pallet { // * 'NonAssociatedColdKey': // - The hotkey we are delegating is not owned by the calling coldkey. // - // * 'InvalidTransaction': + // * 'InvalidTake': // - The delegate is setting a take which is not greater than the previous. // #[pallet::call_index(66)] diff --git a/pallets/subtensor/src/staking.rs b/pallets/subtensor/src/staking.rs index 42c2a1ab9..991c0433e 100644 --- a/pallets/subtensor/src/staking.rs +++ b/pallets/subtensor/src/staking.rs @@ -117,6 +117,9 @@ impl Pallet { // * 'NonAssociatedColdKey': // - The hotkey we are delegating is not owned by the calling coldket. // + // * 'InvalidTake': + // - The delegate is setting a take which is not lower than the previous. + // pub fn do_decrease_take( origin: T::RuntimeOrigin, hotkey: T::AccountId, @@ -173,8 +176,8 @@ impl Pallet { // - The stake proportion that this hotkey takes from delegations for subnet ID. // // # Event: - // * TakeDecreased; - // - On successfully setting a decreased take for this hotkey. + // * TakeIncreased; + // - On successfully setting a increased take for this hotkey. // // # Raises: // * 'NotRegistered': @@ -186,6 +189,9 @@ impl Pallet { // * 'TxRateLimitExceeded': // - Thrown if key has hit transaction rate limit // + // * 'InvalidTake': + // - The delegate is setting a take which is not greater than the previous. + // pub fn do_increase_take( origin: T::RuntimeOrigin, hotkey: T::AccountId,