Skip to content
CCPEDIAby Unity Nodes
App Development

Why is there no `submitUserMustFail`?

3 posts265 views3 likesLast activity Jul 2022

  1. DarkoOP

    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` ...
    
  2. Darko

    The same question also holds for queries

  3. cocreature 3

    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