Should `submitMulti` ever fail due to missing authorization?
- LucianoOP
If I have the code
submitMulti [alice, bob, charlie] [] $ _Should this ever fail with
Scenario execution failed to commit ... failed due to missing authorization from bob?
I’m seeing this behaviour and happy to share a more complex example.
Unfortunately I can’t find much documentation beyond the API reference for
submitMultito try and debug further. - cocreature 2
submitMultidoes not change the authorization rules in Daml at all. Within a choice you still only have authorization of the signatories of the contract and the controllers of the choice. This is crucial to allow local reasoning about authorization. So a minimal example of something similar to your example is the following:module Main where import Daml.Script template T with p : Party q : Party where signatory p nonconsuming choice CreateT : ContractId T controller p do create T with p = q, q test = do p <- allocateParty "p" q <- allocateParty "q" cid <- submit p $ createCmd (T p q) -- fails due to missing authorization from q submitMulti [p, q] [] $ exerciseCmd cid CreateTWhat
submitMultiallows (and the exact same thing applies to using multipleactAsparties on the ledger API) is to have more than one authorizer for the root commands of your transaction. So you could do a bare create that requires signatures frompandqor call a choice that has bothpandqas controllers.But within the body of a choice you only have authorization of signatories & controllers and there is no way to change that.
- Luciano 2
Your minimal example was indeed exactly what was happening in my code; that was very helpful, thank you.