You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it's possible to add account updates to the tx conditionally with AccountUpdate.createIf(), but it's not possible to call another method conditionally.
Since a method call just means adding the account update that another method produces to the AU tree, it should be fairly easy to support conditional method calls. There's simply an additional boolean condition that needs to be considered before pushing the AU to the tree.
The API probably can't be as clean as the current zkApp call API, but I think that's ok, something like this should work well enough:
a clear-cut use case for conditional method calls is spawning method calls from a reducer, where some of the input actions (necessarily) are dummy actions
Currently, it's possible to add account updates to the tx conditionally with
AccountUpdate.createIf()
, but it's not possible to call another method conditionally.Since a method call just means adding the account update that another method produces to the AU tree, it should be fairly easy to support conditional method calls. There's simply an additional boolean condition that needs to be considered before pushing the AU to the tree.
The API probably can't be as clean as the current zkApp call API, but I think that's ok, something like this should work well enough:
note, the method name + arguments can be made type-safe if this is polymorphic over the contract, something like:
The text was updated successfully, but these errors were encountered: