From 59e53beee7d1a33c041663526d38a0043658bd66 Mon Sep 17 00:00:00 2001 From: Cameron Fairchild Date: Wed, 6 Nov 2024 21:45:38 -0500 Subject: [PATCH] add back delta handling in helpers --- pallets/subtensor/src/staking/helpers.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pallets/subtensor/src/staking/helpers.rs b/pallets/subtensor/src/staking/helpers.rs index 0328d94e6..9fd60ea51 100644 --- a/pallets/subtensor/src/staking/helpers.rs +++ b/pallets/subtensor/src/staking/helpers.rs @@ -297,6 +297,9 @@ impl Pallet { staking_hotkeys.retain(|h| h != hotkey); StakingHotkeys::::insert(coldkey, staking_hotkeys); + // Update stake delta + StakeDeltaSinceLastEmissionDrain::::remove(hotkey, coldkey); + current_stake } @@ -431,6 +434,9 @@ impl Pallet { // Add the balance to the coldkey account. Self::add_balance_to_coldkey_account(&delegate_coldkey_i, stake_i); + + // Remove stake delta + StakeDeltaSinceLastEmissionDrain::::remove(hotkey, &delegate_coldkey_i); } } }