File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
pallets/subtensor/src/coinbase Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments