mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 11:38:01 +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:
@@ -121,9 +121,7 @@ decl_module! {
|
||||
/// circumstances that have happened that users, Dapps and/or chain explorers would find
|
||||
/// interesting and otherwise difficult to detect.
|
||||
decl_event!(
|
||||
pub enum Event<T> with RawEvent<B>
|
||||
where <T as balances::Trait>::Balance
|
||||
{
|
||||
pub enum Event<T> where B = <T as balances::Trait>::Balance {
|
||||
// Just a normal `enum`, here's a dummy event to ensure it compiles.
|
||||
/// Dummy event, just here so there's a generic type that's used.
|
||||
Dummy(B),
|
||||
|
||||
Reference in New Issue
Block a user