Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 938e3a2

Browse files
authored
Display Reward amount (#9245)
* name reward amount * Fix
1 parent 4cb4223 commit 938e3a2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

frame/election-provider-multi-phase/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,10 @@ pub mod pallet {
982982
}
983983

984984
#[pallet::event]
985-
#[pallet::metadata(<T as frame_system::Config>::AccountId = "AccountId")]
985+
#[pallet::metadata(
986+
<T as frame_system::Config>::AccountId = "AccountId",
987+
BalanceOf<T> = "Balance"
988+
)]
986989
#[pallet::generate_deposit(pub(super) fn deposit_event)]
987990
pub enum Event<T: Config> {
988991
/// A solution was stored with the given compute.
@@ -996,9 +999,9 @@ pub mod pallet {
996999
/// election failed, `None`.
9971000
ElectionFinalized(Option<ElectionCompute>),
9981001
/// An account has been rewarded for their signed submission being finalized.
999-
Rewarded(<T as frame_system::Config>::AccountId),
1002+
Rewarded(<T as frame_system::Config>::AccountId, BalanceOf<T>),
10001003
/// An account has been slashed for submitting an invalid signed submission.
1001-
Slashed(<T as frame_system::Config>::AccountId),
1004+
Slashed(<T as frame_system::Config>::AccountId, BalanceOf<T>),
10021005
/// The signed phase of the given round has started.
10031006
SignedPhaseStarted(u32),
10041007
/// The unsigned phase of the given round has started.

frame/election-provider-multi-phase/src/signed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ impl<T: Config> Pallet<T> {
417417
<QueuedSolution<T>>::put(ready_solution);
418418

419419
// emit reward event
420-
Self::deposit_event(crate::Event::Rewarded(who.clone()));
420+
Self::deposit_event(crate::Event::Rewarded(who.clone(), reward));
421421

422422
// unreserve deposit.
423423
let _remaining = T::Currency::unreserve(who, deposit);
@@ -434,7 +434,7 @@ impl<T: Config> Pallet<T> {
434434
///
435435
/// Infallible
436436
pub fn finalize_signed_phase_reject_solution(who: &T::AccountId, deposit: BalanceOf<T>) {
437-
Self::deposit_event(crate::Event::Slashed(who.clone()));
437+
Self::deposit_event(crate::Event::Slashed(who.clone(), deposit));
438438
let (negative_imbalance, _remaining) = T::Currency::slash_reserved(who, deposit);
439439
debug_assert!(_remaining.is_zero());
440440
T::SlashHandler::on_unbalanced(negative_imbalance);

0 commit comments

Comments
 (0)