Skip to content

Commit 7e46b95

Browse files
committed
improve & clippy
1 parent 4af68a5 commit 7e46b95

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

pallets/subtensor/src/coinbase/run_coinbase.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,13 @@ impl<T: Config> Pallet<T> {
514514
let owner: T::AccountId = Owner::<T>::get(&hotkey);
515515
let destination = AutoStakeDestination::<T>::get(&owner).unwrap_or(hotkey.clone());
516516

517-
Self::deposit_event(Event::<T>::AutoStakeAdded(
517+
Self::deposit_event(Event::<T>::AutoStakeAdded {
518518
netuid,
519-
destination.clone(),
519+
destination: destination.clone(),
520520
hotkey,
521-
owner.clone(),
521+
owner: owner.clone(),
522522
incentive,
523-
));
523+
});
524524
Self::increase_stake_for_hotkey_and_coldkey_on_subnet(
525525
&destination,
526526
&owner,

pallets/subtensor/src/macros/events.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,16 +415,25 @@ mod events {
415415
TimelockedWeightsRevealed(NetUid, T::AccountId),
416416

417417
/// Auto-staking hotkey received stake
418-
AutoStakeAdded(
419-
NetUid,
420-
T::AccountId,
421-
T::AccountId,
422-
T::AccountId,
423-
AlphaCurrency,
424-
),
425-
/// EpochIncentives
418+
AutoStakeAdded {
419+
/// Subnet identifier.
420+
netuid: NetUid,
421+
/// Destination account that received the auto-staked funds.
422+
destination: T::AccountId,
423+
/// Hotkey account whose stake was auto-staked.
424+
hotkey: T::AccountId,
425+
/// Owner (coldkey) account associated with the hotkey.
426+
owner: T::AccountId,
427+
/// Amount of alpha auto-staked.
428+
incentive: AlphaCurrency,
429+
},
430+
431+
/// End-of-epoch miner incentive alpha by UID (server emission).
432+
/// `emissions[uid]` = alpha emitted to that UID (0..n-1).
426433
IncentiveAlphaEmittedToMiners {
434+
/// Subnet identifier.
427435
netuid: NetUid,
436+
/// UID-indexed array of miner incentive alpha; index equals UID.
428437
emissions: Vec<AlphaCurrency>,
429438
},
430439
}

0 commit comments

Comments
 (0)