-
Notifications
You must be signed in to change notification settings - Fork 141
[Compiler] Emit default destroyed events when resources are destroyed #4004
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
Conversation
…into supun/destroy-event
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:feature/compiler commit c99075e Collapsed results for better readability
|
Great work! It makes sense to compile to a method, so In the examples, what do |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
Work towards #3993
Description
There are a few important points/behaviours that needed to be upheld by the implementation:
Implementation Approach
ResourceDestroyed
event, that assigns the parameters to fields.ResourceDestroyed
event, generate a getter-function, that return an array of events.$ResourceDestroyed()
to get the event-values. Then once the resource is destroyed, emit the retrieved event-values (this part is already available in the value-implementation).Alternatives Considered
Directly emit the event inside the generated
$ResourceDestroyed
function, rather than returning the event-values.The problem is this will both construct and emit the event before the resource is destroyed.
Return the event's fields only by the
$ResourceDestroyed
function, rather than constructing an event value.master
branchFiles changed
in the Github PR explorer