Daml.Trigger.Assert

Data Types

data ACSBuilder

Used to construct an ‘ACS’ for ‘testRule’.

instance Monoid ACSBuilder

instance Semigroup ACSBuilder

Functions

toACS

: (Template t, HasAgreement t) => ContractId t -> ACSBuilder

Include the given contract in the ‘ACS’. Note that the ContractId must point to an active contract.

testRule

: Trigger s -> Party -> [Party] -> ACSBuilder -> Map CommandId [Command] -> s -> Script (s, [Commands])

Execute a trigger’s rule once in a scenario.

flattenCommands

: [Commands] -> [Command]

Drop ‘CommandId’s and extract all ‘Command’s.

assertCreateCmd

: (Template t, HasAgreement t, CanAbort m) => [Command] -> (t -> Either Text ()) -> m ()

Check that at least one command is a create command whose payload fulfills the given assertions.

assertExerciseCmd

: (Template t, HasAgreement t, Choice t c r, CanAbort m) => [Command] -> ((ContractId t, c) -> Either Text ()) -> m ()

Check that at least one command is an exercise command whose contract id and choice argument fulfill the given assertions.

assertExerciseByKeyCmd

: (TemplateKey t k, Choice t c r, CanAbort m) => [Command] -> ((k, c) -> Either Text ()) -> m ()

Check that at least one command is an exercise by key command whose key and choice argument fulfill the given assertions.