Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event defintions with generics #2044

Open
ascjones opened this issue Jan 5, 2024 · 0 comments
Open

Event defintions with generics #2044

ascjones opened this issue Jan 5, 2024 · 0 comments
Labels
A-ink_lang [ink_lang] Work item B-enhancement New feature or request

Comments

@ascjones
Copy link
Collaborator

ascjones commented Jan 5, 2024

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,
}
@ascjones ascjones added B-enhancement New feature or request A-ink_lang [ink_lang] Work item labels Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ink_lang [ink_lang] Work item B-enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant