acceptRule : Party -> ACS -> Time -> Map CommandId [Command] -> s -> TriggerA ()
acceptRule party acs t pending s = do
let proposals = getContracts @IssueProposal acs
let pcids = map fst proposals
let cmds = map (\cid -> exerciseCmd cid Accept) pcids
let pendings = map (\c -> c.contractId) cmds
emitCommands cmds pendings
pure ()
When I try to run it I get the following message repeated indefinitely:
I’m somewhat guessing here but I believe that cmds is probably empty. The ledger API does not accept empty list of commands. If that is the issue you can simply wrap it in when:
when (not (null cmds)) (emitCommands cmds pendings)
Might make sense to modify emitCommands to handle this automatically.