mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 10:15:42 +00:00
Make decl_event! more ergonomic (#723)
* Improve and simplify `decl_event!` - RawEvent is not required anymore to be written in the defintion - Events with and without parameters are now supported everywhere * Make `decl_event!` more flexible with the automatic naming of generic parameters The macro will now automatically derive the name of a generic parameter from the trait type name, if no explicit name is given. `where Balance = <T as Trait>::Balance` can be simplified to `where <T as Trait>::Balance`. * Adapts to latest refactoring changes
This commit is contained in:
@@ -49,9 +49,7 @@ pub enum Origin {
|
||||
|
||||
/// Event for this module.
|
||||
decl_event!(
|
||||
pub enum Event<T> with RawEvent<Hash, AccountId>
|
||||
where <T as system::Trait>::Hash, <T as system::Trait>::AccountId
|
||||
{
|
||||
pub enum Event<T> where <T as system::Trait>::Hash, <T as system::Trait>::AccountId {
|
||||
/// A motion (given hash) has been proposed (by given account) with a threshold (given u32).
|
||||
Proposed(AccountId, ProposalIndex, Hash, u32),
|
||||
/// A motion (given hash) has been voted on by given account, leaving
|
||||
|
||||
@@ -156,9 +156,7 @@ decl_storage! {
|
||||
|
||||
decl_event!(
|
||||
/// An event in this module.
|
||||
pub enum Event<T> with RawEvent<AccountId>
|
||||
where <T as system::Trait>::AccountId
|
||||
{
|
||||
pub enum Event<T> where <T as system::Trait>::AccountId {
|
||||
/// reaped voter, reaper
|
||||
VoterReaped(AccountId, AccountId),
|
||||
/// slashed reaper
|
||||
|
||||
@@ -55,9 +55,7 @@ decl_storage! {
|
||||
|
||||
/// An event in this module.
|
||||
decl_event!(
|
||||
pub enum Event<T> with RawEvent<Hash>
|
||||
where <T as system::Trait>::Hash
|
||||
{
|
||||
pub enum Event<T> where <T as system::Trait>::Hash {
|
||||
/// A voting tally has happened for a referendum cancelation vote.
|
||||
/// Last three are yes, no, abstain counts.
|
||||
TallyCancelation(Hash, u32, u32, u32),
|
||||
|
||||
Reference in New Issue
Block a user