How does getContracts
work in triggers? Does it operate on the full ACS of the ledger or is the ACS prefiltered by the registeredTemplates
?
Given the example below would I get anything in the list cs
(assuming there are any C
contracts)?
example : Trigger ()
example = Trigger
{ initialize = const ()
, updateState = \_ _ _ -> ()
, rule = exampleRule
, registeredTemplates = RegisteredTemplates [
registeredTemplate @A
, registeredTemplate @B
]
, heartbeat = None
}
exampleRule : Party -> ACS -> Time -> Maps.Map CommandId [Command] -> () -> TriggerA ()
exampleRule party activeContracts _ _ () = do
let cs = getContracts @C activeContracts
pure ()