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

Support Composite Types (struct) as event parameters #313

Closed
3 tasks
joshuahannan opened this issue Aug 11, 2020 · 4 comments · Fixed by #364
Closed
3 tasks

Support Composite Types (struct) as event parameters #313

joshuahannan opened this issue Aug 11, 2020 · 4 comments · Fixed by #364
Assignees

Comments

@joshuahannan
Copy link
Member

joshuahannan commented Aug 11, 2020

Issue To Be Solved

It would be useful to be able to use a composite type as an event parameter so contracts can communicate complex information with the outside world without having to awkwardly split up the data.

Suggest A Solution

  • Support for any struct as a event parameter
  • Support for understanding and parsing the struct in other languages like Go.
  • Do not support resources

Context

This is blocking our ability to efficiently emit important events in the Flow Epoch Smart Contracts. We have a workaround, but would prefer to emit structs in our events.

Definition of Done

  • Sema: Allow structs as event parameters
  • Tests: Sema, Interpreter
  • Documentation
@turbolent
Copy link
Member

This should be easy to support for structs, as they are copied.

The change itself would entail adding a case in sema.IsValidEventParameterType

@turbolent turbolent added the Good First Issue Good for newcomers label Aug 11, 2020
@turbolent
Copy link
Member

@joshuahannan This is a good first issue, would anyone from the Reliability Pod working on the contracts be willing to pick this up? It should be fairly small and I'd be happy to assist

@joshuahannan
Copy link
Member Author

I could do it if you can help me out!

@turbolent
Copy link
Member

Definitely! Let me know when you'd have time and we could pair up if you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants