Skip to content

Commit

Permalink
[Triggers] prevent attempt of creating of interface (#18961)
Browse files Browse the repository at this point in the history
as creating interface result in a crash.

This bug was discover as discussing on the forum:
https://discuss.daml.com/t/creating-contracts-via-their-interface-in-daml-script/7197
  • Loading branch information
remyhaemmerle-da committed Apr 10, 2024
1 parent 463196f commit 7ca3419
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdk/triggers/daml/Daml/Trigger.daml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ emitCommandsV2 cmds pending = do
-- Note that this will send the create as a single-command transaction.
-- If you need to send multiple commands in one transaction, use
-- `emitCommands` with `createCmd` and handle filtering yourself.
dedupCreate : (Eq t, Template t) => t -> TriggerA s ()
dedupCreate : (Eq t, Template t, HasAgreement t) => t -> TriggerA s ()
dedupCreate t = do
aState <- liftTriggerRule get
-- This is a very naive approach that is linear in the number of commands in flight.
Expand Down
2 changes: 1 addition & 1 deletion sdk/triggers/daml/Daml/Trigger/LowLevel.daml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ data Command
}

-- | Create a contract of the given template.
createCmd : Template t => t -> Command
createCmd : (Template t, HasAgreement t) => t -> Command
createCmd templateArg =
CreateCommand (toAnyTemplate templateArg)

Expand Down

0 comments on commit 7ca3419

Please sign in to comment.