Skip to content

Event defintions with generics #2044

@ascjones

Description

@ascjones

Follow up from #1827 (comment).

Currently the Event derive does not support generics. We should consider adding support for generic event definitions, that would allow the event definition to be used across contracts with different Environment types e.g.

#[ink::event]
pub struct Transfer<E: ink::env::Environment> {
    #[ink(topic)]
    from: Option<E::AccountId>,
    #[ink(topic)]
    to: Option<E::AccountId>,
    value: E::Balance,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions