|
@@ -263,10 +263,11 @@ decl_event!(
|
|
|
|
|
|
/// Emits on paying the reward.
|
|
|
/// Params:
|
|
|
+ /// - Id of the worker.
|
|
|
/// - Receiver Account Id.
|
|
|
/// - Reward
|
|
|
/// - Payment type (missed reward or regular one)
|
|
|
- RewardPaid(AccountId, Balance, RewardPaymentType),
|
|
|
+ RewardPaid(WorkerId, AccountId, Balance, RewardPaymentType),
|
|
|
|
|
|
/// Emits on reaching new missed reward.
|
|
|
/// Params:
|
|
@@ -1317,6 +1318,7 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
|
|
|
// Check whether the budget is not zero.
|
|
|
if actual_reward > Zero::zero() {
|
|
|
Self::pay_reward(
|
|
|
+ worker_id,
|
|
|
&worker.reward_account_id,
|
|
|
actual_reward,
|
|
|
RewardPaymentType::RegularReward,
|
|
@@ -1345,12 +1347,14 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
|
|
|
|
|
|
// Helper-function joining the reward payment with the event.
|
|
|
fn pay_reward(
|
|
|
+ worker_id: &WorkerId<T>,
|
|
|
account_id: &T::AccountId,
|
|
|
amount: BalanceOf<T>,
|
|
|
reward_payment_type: RewardPaymentType,
|
|
|
) {
|
|
|
Self::pay_from_budget(account_id, amount);
|
|
|
Self::deposit_event(RawEvent::RewardPaid(
|
|
|
+ *worker_id,
|
|
|
account_id.clone(),
|
|
|
amount,
|
|
|
reward_payment_type,
|
|
@@ -1366,6 +1370,7 @@ impl<T: Trait<I>, I: Instance> Module<T, I> {
|
|
|
// Checks if the budget allows any payment.
|
|
|
if could_be_paid_reward > Zero::zero() {
|
|
|
Self::pay_reward(
|
|
|
+ worker_id,
|
|
|
&worker.reward_account_id,
|
|
|
could_be_paid_reward,
|
|
|
RewardPaymentType::MissedReward,
|