Skip to content
CCPEDIAby Unity Nodes
App Development

What is the difference between a transaction and completion message in a Daml trigger?

5 posts194 views1 likesLast activity Aug 2022

  1. asarpeshkarOP 1

    A trigger’s updateState function has the signature Message -> TriggerUpdateA s (). A Message can be a Transaction, Completion, or Heartbeat, which indicates that they’re mutually exclusive. However, Completion is the only message that includes a completion status.

    For successful transactions, when would one receive a Completion rather than a Transaction?

    And for a failed transaction, would one always receive a Completion rather than a Transaction?

  2. cocreature

    For a successful commands you will receive both a transaction and a completion. For failed commands you will only received a failded completion. Triggers just mirror the transaction service and completion service.

  3. asarpeshkar

    So for successful commands, updateState will be invoked twice?

  4. cocreature

    Yes, you don’t get guarantees about the order just like you don’t get guarantees if you subscribe to the corresponding ledger API streams.

  5. asarpeshkar

    Thanks, it’s helpful to know that the semantics mirror the ledger API.