mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 14:01:06 +00:00
Add pallet names to Events (#10296)
* chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: add pallet names to events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * chore: formatted pallet name changes in events * fix: add fix to tests for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified comments for event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: modified system pallet event variants * chore: updated transaction-storage pallet event variants * chore: updated transaction-storage pallet event variants * chore: formatted contracts pallet * chore: update treasury event variants
This commit is contained in:
@@ -475,42 +475,41 @@ pub mod pallet {
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config<I>, I: 'static = ()> {
|
||||
/// The society is founded by the given identity. \[founder\]
|
||||
Founded(T::AccountId),
|
||||
/// The society is founded by the given identity.
|
||||
Founded { founder: T::AccountId },
|
||||
/// A membership bid just happened. The given account is the candidate's ID and their offer
|
||||
/// is the second. \[candidate_id, offer\]
|
||||
Bid(T::AccountId, BalanceOf<T, I>),
|
||||
/// is the second.
|
||||
Bid { candidate_id: T::AccountId, offer: BalanceOf<T, I> },
|
||||
/// A membership bid just happened by vouching. The given account is the candidate's ID and
|
||||
/// their offer is the second. The vouching party is the third. \[candidate_id, offer,
|
||||
/// vouching\]
|
||||
Vouch(T::AccountId, BalanceOf<T, I>, T::AccountId),
|
||||
/// A \[candidate\] was dropped (due to an excess of bids in the system).
|
||||
AutoUnbid(T::AccountId),
|
||||
/// A \[candidate\] was dropped (by their request).
|
||||
Unbid(T::AccountId),
|
||||
/// A \[candidate\] was dropped (by request of who vouched for them).
|
||||
Unvouch(T::AccountId),
|
||||
/// their offer is the second. The vouching party is the third.
|
||||
Vouch { candidate_id: T::AccountId, offer: BalanceOf<T, I>, vouching: T::AccountId },
|
||||
/// A candidate was dropped (due to an excess of bids in the system).
|
||||
AutoUnbid { candidate: T::AccountId },
|
||||
/// A candidate was dropped (by their request).
|
||||
Unbid { candidate: T::AccountId },
|
||||
/// A candidate was dropped (by request of who vouched for them).
|
||||
Unvouch { candidate: T::AccountId },
|
||||
/// A group of candidates have been inducted. The batch's primary is the first value, the
|
||||
/// batch in full is the second. \[primary, candidates\]
|
||||
Inducted(T::AccountId, Vec<T::AccountId>),
|
||||
/// A suspended member has been judged. \[who, judged\]
|
||||
SuspendedMemberJudgement(T::AccountId, bool),
|
||||
/// A \[candidate\] has been suspended
|
||||
CandidateSuspended(T::AccountId),
|
||||
/// A \[member\] has been suspended
|
||||
MemberSuspended(T::AccountId),
|
||||
/// A \[member\] has been challenged
|
||||
Challenged(T::AccountId),
|
||||
/// A vote has been placed \[candidate, voter, vote\]
|
||||
Vote(T::AccountId, T::AccountId, bool),
|
||||
/// A vote has been placed for a defending member \[voter, vote\]
|
||||
DefenderVote(T::AccountId, bool),
|
||||
/// batch in full is the second.
|
||||
Inducted { primary: T::AccountId, candidates: Vec<T::AccountId> },
|
||||
/// A suspended member has been judged.
|
||||
SuspendedMemberJudgement { who: T::AccountId, judged: bool },
|
||||
/// A candidate has been suspended
|
||||
CandidateSuspended { candidate: T::AccountId },
|
||||
/// A member has been suspended
|
||||
MemberSuspended { member: T::AccountId },
|
||||
/// A member has been challenged
|
||||
Challenged { member: T::AccountId },
|
||||
/// A vote has been placed
|
||||
Vote { candidate: T::AccountId, voter: T::AccountId, vote: bool },
|
||||
/// A vote has been placed for a defending member
|
||||
DefenderVote { voter: T::AccountId, vote: bool },
|
||||
/// A new \[max\] member count has been set
|
||||
NewMaxMembers(u32),
|
||||
/// Society is unfounded. \[founder\]
|
||||
Unfounded(T::AccountId),
|
||||
/// Some funds were deposited into the society account. \[value\]
|
||||
Deposit(BalanceOf<T, I>),
|
||||
NewMaxMembers { max: u32 },
|
||||
/// Society is unfounded.
|
||||
Unfounded { founder: T::AccountId },
|
||||
/// Some funds were deposited into the society account.
|
||||
Deposit { value: BalanceOf<T, I> },
|
||||
}
|
||||
|
||||
/// Old name generated by `decl_event`.
|
||||
@@ -729,7 +728,7 @@ pub mod pallet {
|
||||
T::Currency::reserve(&who, deposit)?;
|
||||
|
||||
Self::put_bid(bids, &who, value.clone(), BidKind::Deposit(deposit));
|
||||
Self::deposit_event(Event::<T, I>::Bid(who, value));
|
||||
Self::deposit_event(Event::<T, I>::Bid { candidate_id: who, offer: value });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -771,7 +770,7 @@ pub mod pallet {
|
||||
<Vouching<T, I>>::remove(&voucher);
|
||||
},
|
||||
}
|
||||
Self::deposit_event(Event::<T, I>::Unbid(who));
|
||||
Self::deposit_event(Event::<T, I>::Unbid { candidate: who });
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::<T, I>::BadPosition)?
|
||||
@@ -849,7 +848,11 @@ pub mod pallet {
|
||||
|
||||
<Vouching<T, I>>::insert(&voucher, VouchingStatus::Vouching);
|
||||
Self::put_bid(bids, &who, value.clone(), BidKind::Vouch(voucher.clone(), tip));
|
||||
Self::deposit_event(Event::<T, I>::Vouch(who, value, voucher));
|
||||
Self::deposit_event(Event::<T, I>::Vouch {
|
||||
candidate_id: who,
|
||||
offer: value,
|
||||
vouching: voucher,
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -884,7 +887,7 @@ pub mod pallet {
|
||||
b[pos].kind.check_voucher(&voucher)?;
|
||||
<Vouching<T, I>>::remove(&voucher);
|
||||
let who = b.remove(pos).who;
|
||||
Self::deposit_event(Event::<T, I>::Unvouch(who));
|
||||
Self::deposit_event(Event::<T, I>::Unvouch { candidate: who });
|
||||
Ok(())
|
||||
} else {
|
||||
Err(Error::<T, I>::BadPosition)?
|
||||
@@ -927,7 +930,7 @@ pub mod pallet {
|
||||
let vote = if approve { Vote::Approve } else { Vote::Reject };
|
||||
<Votes<T, I>>::insert(&candidate, &voter, vote);
|
||||
|
||||
Self::deposit_event(Event::<T, I>::Vote(candidate, voter, approve));
|
||||
Self::deposit_event(Event::<T, I>::Vote { candidate, voter, vote: approve });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -956,7 +959,7 @@ pub mod pallet {
|
||||
let vote = if approve { Vote::Approve } else { Vote::Reject };
|
||||
<DefenderVotes<T, I>>::insert(&voter, vote);
|
||||
|
||||
Self::deposit_event(Event::<T, I>::DefenderVote(voter, approve));
|
||||
Self::deposit_event(Event::<T, I>::DefenderVote { voter, vote: approve });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1039,7 +1042,7 @@ pub mod pallet {
|
||||
<Head<T, I>>::put(&founder);
|
||||
<Founder<T, I>>::put(&founder);
|
||||
Rules::<T, I>::put(T::Hashing::hash(&rules));
|
||||
Self::deposit_event(Event::<T, I>::Founded(founder));
|
||||
Self::deposit_event(Event::<T, I>::Founded { founder });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1068,7 +1071,7 @@ pub mod pallet {
|
||||
Rules::<T, I>::kill();
|
||||
Candidates::<T, I>::kill();
|
||||
SuspendedCandidates::<T, I>::remove_all(None);
|
||||
Self::deposit_event(Event::<T, I>::Unfounded(founder));
|
||||
Self::deposit_event(Event::<T, I>::Unfounded { founder });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1125,14 +1128,14 @@ pub mod pallet {
|
||||
if let Some(pos) = bids.iter().position(|b| b.kind.check_voucher(&who).is_ok()) {
|
||||
// Remove the bid, and emit an event
|
||||
let vouched = bids.remove(pos).who;
|
||||
Self::deposit_event(Event::<T, I>::Unvouch(vouched));
|
||||
Self::deposit_event(Event::<T, I>::Unvouch { candidate: vouched });
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
<SuspendedMembers<T, I>>::remove(&who);
|
||||
Self::deposit_event(Event::<T, I>::SuspendedMemberJudgement(who, forgive));
|
||||
Self::deposit_event(Event::<T, I>::SuspendedMemberJudgement { who, judged: forgive });
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -1253,7 +1256,7 @@ pub mod pallet {
|
||||
ensure_root(origin)?;
|
||||
ensure!(max > 1, Error::<T, I>::MaxMembers);
|
||||
MaxMembers::<T, I>::put(max);
|
||||
Self::deposit_event(Event::<T, I>::NewMaxMembers(max));
|
||||
Self::deposit_event(Event::<T, I>::NewMaxMembers { max });
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -1339,7 +1342,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
<Vouching<T, I>>::remove(&voucher);
|
||||
},
|
||||
}
|
||||
Self::deposit_event(Event::<T, I>::AutoUnbid(popped));
|
||||
Self::deposit_event(Event::<T, I>::AutoUnbid { candidate: popped });
|
||||
}
|
||||
|
||||
<Bids<T, I>>::put(bids);
|
||||
@@ -1504,7 +1507,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
} else {
|
||||
// Suspend Candidate
|
||||
<SuspendedCandidates<T, I>>::insert(&candidate, (value, kind));
|
||||
Self::deposit_event(Event::<T, I>::CandidateSuspended(candidate));
|
||||
Self::deposit_event(Event::<T, I>::CandidateSuspended { candidate });
|
||||
None
|
||||
}
|
||||
})
|
||||
@@ -1573,7 +1576,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
<Head<T, I>>::put(&primary);
|
||||
|
||||
T::MembershipChanged::change_members_sorted(&accounts, &[], &members);
|
||||
Self::deposit_event(Event::<T, I>::Inducted(primary, accounts));
|
||||
Self::deposit_event(Event::<T, I>::Inducted { primary, candidates: accounts });
|
||||
}
|
||||
|
||||
// Bump the pot by at most PeriodSpend, but less if there's not very much left in our
|
||||
@@ -1638,7 +1641,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
if Self::remove_member(&who).is_ok() {
|
||||
<SuspendedMembers<T, I>>::insert(who, true);
|
||||
<Strikes<T, I>>::remove(who);
|
||||
Self::deposit_event(Event::<T, I>::MemberSuspended(who.clone()));
|
||||
Self::deposit_event(Event::<T, I>::MemberSuspended { member: who.clone() });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1716,7 +1719,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
let chosen = pick_item(&mut rng, &members[1..members.len() - 1])
|
||||
.expect("exited if members empty; qed");
|
||||
<Defender<T, I>>::put(&chosen);
|
||||
Self::deposit_event(Event::<T, I>::Challenged(chosen.clone()));
|
||||
Self::deposit_event(Event::<T, I>::Challenged { member: chosen.clone() });
|
||||
} else {
|
||||
<Defender<T, I>>::kill();
|
||||
}
|
||||
@@ -1820,6 +1823,6 @@ impl<T: Config<I>, I: 'static> OnUnbalanced<NegativeImbalanceOf<T, I>> for Palle
|
||||
// Must resolve into existing but better to be safe.
|
||||
let _ = T::Currency::resolve_creating(&Self::account_id(), amount);
|
||||
|
||||
Self::deposit_event(Event::<T, I>::Deposit(numeric_amount));
|
||||
Self::deposit_event(Event::<T, I>::Deposit { value: numeric_amount });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user