When do unallocated parties cause errors?
- bernhardOP 1
I recently got this question through another channel (thank you @Shine_Li for asking) and wanted to share both question and answer here:
I’m on
1.4.0-snapshot.20200729.4851.0.224ab362. And I’m using sandbox (not the classic) with--implicit-party-allocation false. I have managed to save a Party (that is not allocated) on more than one contracts. But when I exercise choice using that party, I have failureStatus(3,Party not known on ledger: Not all parties known,Vector())Should it be errored out on saving the party on a contract? - bernhard 4
You only get errors if the party is “used” as signatory, observer, or controller/actor. Note that in the
choice ...syntax, controllers are only evaluated at the time an exercise is performed so the following workstemplate T with allocated : Party unallocated : Party where signatory allocated choice C : () controller unallocated do return ()You’ll get an error as soon as you try to exercise
C, though that may be a moot point since I don’t see a way to exerciseCwithout allocating the party first.controller unallocated canwill fail immediately because that syntax makesunallocatedan observer.