Why is there no `submitUserMustFail`?

Is there a particular reason why not all party submission functions also exist for users?
(For example submitUserMustFail)

When it comes to submitMulti I’m assuming that the argument would be to just add the additional actAs/readAs parties to the user, but I don’t see an easy workaround for ..MustFail, except to use

(fromSome myUser.primaryParty) `submitMustFail` ...

The same question also holds for queries

There is no good reason, we just started with the minimal API. However, submitUser is just a wrapper, you can see the definition in the code.

You can relatively easily define your own wrapper for submitMultiMustFail:

submitUserMustFail : HasCallStack => UserId -> Commands a -> Script ()
submitUserMustFail userId cmds = do
  rights <- listUserRights userId
  let actAs = [ p | CanActAs p <- rights ]
  let readAs = [ p | CanReadAs p <- rights ]
  submitMultiMustFail actAs readAs cmds
3 Likes