-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a guard when exercising by interface. (#11836)
* Add a guard when exercising by interface. This fixes part of #11703, when exercising an inherited choice by interface and you know the template id, via the command preprocessor. It does this by inserting a "guard" in between the interface fetch and the exercise body. The guard is a function Interface -> Bool, which is general enough to check the template id, without complicating too much in speedy. And can be generalized in the future to check more, like signatories, etc. I added the guard as an optional argument to UExerciseByInterface. This isn't hooked up to the protobuf AST yet (or Haskell side for that matter) -- but I'll do it in the next PR! For now you can invoke the guarded exercise via the command preprocessor, so I can enable the approprate engine tests. (There's still some failing fetch tests left, but I decided to leave this for later. Fetch can be a lot simpler than guarded choices, since you always add a fetch node. No need for fancy continuations.) changelog_begin changelog_end * scalafmt * Feedback and fix matches * Update comments, we are always going to abort the transaction * Raise WronglyTypedContract in SBGuardTemplateId. * rebase and fix parser * restore ANF * scalafmt
- Loading branch information
1 parent
7c3a2a7
commit 5c12d75
Showing
19 changed files
with
265 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.