Skip to content

Commit b033d0e

Browse files
authored
Merge pull request #2035 from opentensor/incentive-alpha-emitted-to-miners
conditional AutoStakeAdded
2 parents 86c1d31 + 23b32c7 commit b033d0e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,15 +512,20 @@ impl<T: Config> Pallet<T> {
512512
}
513513

514514
let owner: T::AccountId = Owner::<T>::get(&hotkey);
515-
let destination = AutoStakeDestination::<T>::get(&owner).unwrap_or(hotkey.clone());
515+
let maybe_dest = AutoStakeDestination::<T>::get(&owner);
516516

517-
Self::deposit_event(Event::<T>::AutoStakeAdded {
518-
netuid,
519-
destination: destination.clone(),
520-
hotkey,
521-
owner: owner.clone(),
522-
incentive,
523-
});
517+
// Always stake but only emit event if autostake is set.
518+
let destination = maybe_dest.clone().unwrap_or(hotkey.clone());
519+
520+
if let Some(dest) = maybe_dest {
521+
Self::deposit_event(Event::<T>::AutoStakeAdded {
522+
netuid,
523+
destination: dest,
524+
hotkey: hotkey.clone(),
525+
owner: owner.clone(),
526+
incentive,
527+
});
528+
}
524529
Self::increase_stake_for_hotkey_and_coldkey_on_subnet(
525530
&destination,
526531
&owner,

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
220220
// `spec_version`, and `authoring_version` are the same between Wasm and native.
221221
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
222222
// the compatible custom types.
223-
spec_version: 314,
223+
spec_version: 315,
224224
impl_version: 1,
225225
apis: RUNTIME_API_VERSIONS,
226226
transaction_version: 1,

0 commit comments

Comments
 (0)