-
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.
Handle fetchByKey callback correctly in scenario runner (#10980)
fixes #10977 Turns out assertions are good unless they’re wrong … This only affects scenarios, the engine never looks at the callback. changelog_begin changelog_end
- Loading branch information
1 parent
23e6a2d
commit 99836d2
Showing
3 changed files
with
44 additions
and
3 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
compiler/damlc/tests/daml-test-files/ConsumedContractKey.daml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- @ERROR range=23:1-23:32; no contract with that key was found | ||
-- @ERROR range=33:1-33:29; consumed in same transaction | ||
module ConsumedContractKey where | ||
|
||
template Foo | ||
with | ||
signer: Party | ||
where | ||
signatory signer | ||
key signer : Party | ||
maintainer key | ||
controller signer can | ||
FetchKey : Foo | ||
do | ||
snd <$> fetchByKey @Foo signer | ||
LookupKey : () | ||
do | ||
None <- lookupByKey @Foo signer | ||
pure () | ||
Fetch : Foo | ||
do fetch self | ||
|
||
testFetchKeyFromConsumingChoice = do | ||
alice <- getParty "Alice" | ||
fooId <- alice `submit` create Foo with signer = alice | ||
alice `submit` exercise fooId FetchKey | ||
|
||
testLookupKeyFromConsumingChoice = do | ||
alice <- getParty "Alice" | ||
fooId <- alice `submit` create Foo with signer = alice | ||
alice `submit` exercise fooId LookupKey | ||
|
||
testFetchFromConsumingChoice = do | ||
alice <- getParty "Alice" | ||
fooId <- alice `submit` create Foo with signer = alice | ||
alice `submit` exercise fooId Fetch |
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