diff --git a/pallets/subtensor/src/staking/helpers.rs b/pallets/subtensor/src/staking/helpers.rs index 0d38febd2..17e260c54 100644 --- a/pallets/subtensor/src/staking/helpers.rs +++ b/pallets/subtensor/src/staking/helpers.rs @@ -121,17 +121,6 @@ impl Pallet { Owner::::get(hotkey) } - /// Returns the hotkey take. - /// - /// # Arguments - /// * `hotkey` - The hotkey account ID. - /// - /// # Returns - /// The take value of the hotkey. - pub fn get_hotkey_take(hotkey: &T::AccountId) -> u16 { - Delegates::::get(hotkey) - } - /// Returns true if the hotkey account has been created. /// /// # Arguments diff --git a/pallets/subtensor/src/tests/staking.rs b/pallets/subtensor/src/tests/staking.rs index 0c8b955d7..a051d5c52 100644 --- a/pallets/subtensor/src/tests/staking.rs +++ b/pallets/subtensor/src/tests/staking.rs @@ -1698,7 +1698,7 @@ fn test_delegate_take_can_be_decreased() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1744,7 +1744,7 @@ fn test_can_set_min_take_ok() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); }); @@ -1773,7 +1773,7 @@ fn test_delegate_take_can_not_be_increased_with_decrease_take() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1787,7 +1787,7 @@ fn test_delegate_take_can_not_be_increased_with_decrease_take() { Err(Error::::DelegateTakeTooLow.into()) ); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); }); @@ -1816,7 +1816,7 @@ fn test_delegate_take_can_be_increased() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1828,7 +1828,7 @@ fn test_delegate_take_can_be_increased() { hotkey0, u16::MAX / 8 )); - assert_eq!(SubtensorModule::get_hotkey_take(&hotkey0), u16::MAX / 8); + assert_eq!(Delegates::::get(&hotkey0), u16::MAX / 8); }); } @@ -1855,7 +1855,7 @@ fn test_delegate_take_can_not_be_decreased_with_increase_take() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1869,7 +1869,7 @@ fn test_delegate_take_can_not_be_decreased_with_increase_take() { Err(Error::::DelegateTakeTooLow.into()) ); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); }); @@ -1898,7 +1898,7 @@ fn test_delegate_take_can_be_increased_to_limit() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1911,7 +1911,7 @@ fn test_delegate_take_can_be_increased_to_limit() { InitialDefaultDelegateTake::get() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), InitialDefaultDelegateTake::get() ); }); @@ -1932,7 +1932,7 @@ fn test_delegate_take_can_not_be_set_beyond_limit() { let netuid = 1; add_network(netuid, 0, 0); register_ok_neuron(netuid, hotkey0, coldkey0, 124124); - let before = SubtensorModule::get_hotkey_take(&hotkey0); + let before = Delegates::::get(&hotkey0); // Coldkey / hotkey 0 attempt to become delegates with take above maximum // (Disable this check if InitialDefaultDelegateTake is u16::MAX) @@ -1946,7 +1946,7 @@ fn test_delegate_take_can_not_be_set_beyond_limit() { Err(Error::::DelegateTakeTooHigh.into()) ); } - assert_eq!(SubtensorModule::get_hotkey_take(&hotkey0), before); + assert_eq!(Delegates::::get(&hotkey0), before); }); } @@ -1973,7 +1973,7 @@ fn test_delegate_take_can_not_be_increased_beyond_limit() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -1990,7 +1990,7 @@ fn test_delegate_take_can_not_be_increased_beyond_limit() { ); } assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); }); @@ -2019,7 +2019,7 @@ fn test_rate_limits_enforced_on_increase_take() { SubtensorModule::get_min_delegate_take() )); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -2033,7 +2033,7 @@ fn test_rate_limits_enforced_on_increase_take() { Err(Error::::DelegateTxRateLimitExceeded.into()) ); assert_eq!( - SubtensorModule::get_hotkey_take(&hotkey0), + Delegates::::get(&hotkey0), SubtensorModule::get_min_delegate_take() ); @@ -2045,7 +2045,7 @@ fn test_rate_limits_enforced_on_increase_take() { hotkey0, u16::MAX / 8 )); - assert_eq!(SubtensorModule::get_hotkey_take(&hotkey0), u16::MAX / 8); + assert_eq!(Delegates::::get(&hotkey0), u16::MAX / 8); }); }