Skip to content

Ease passing data from before to after hooks #3636

Open
@dk1a

Description

@dk1a

I need both the previous and the current value of an arbitrary table in a hook

  • Then I either form the updated value in onBefore using hook arguments, which can get very complex with splices and all the different hooks
  • Or I pass the previous value from onBefore to onAfter using some storage stack, which can get gas intensive (and possibly leaky?)

I think having onBefore return a memory blob, and onAfter accept it as an argument would significantly improve this issue.
It's simple enough and I can PR it if you agree with the idea

On the other hand it's not a significant issue, especially if you think this solution would cause more problems

Perhaps this could apply to system hook too, but I don't have a use-case in mind

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions