Do triggers get full ACS or prefiltered?

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 ()
1 Like

Hey @Tamas_Kalcza, it looks like this post answers your question: Does the registeredTemplates field in a DAML Trigger affect the ACS which is threaded through my rule?.

So the ACS seen by your exampleRule would be prefiltered by registeredTemplates and getContracts should return an empty list.

2 Likes

Thanks @rohanjr

2 Likes