Hi all,
I want to double-check my understanding regarding the visibility of choice parameters to observers in non-consuming choices.
Since observers do not get informed about the execution of a nonconsuming choice, they also do not see any parameters that have been passed into the choice, even if there is an archive within that choice.
Is that correct?
I have prepared an example below, and the question is, given the following code, does Charlie
ever get to see privateData
. Looking at the transaction graph I don’t believe he does, but I want to make sure.
module Main where
import Daml.Script
type PrivateResultId = ContractId PrivateResult
template PublicContract
with
partyA : Party
parties : [Party]
where
signatory partyA
observer parties
nonconsuming choice PrivateChoice : PrivateResultId with
actor: Party
privateData : Text
controller actor
do
assert (actor `elem` parties)
archive self
create PrivateResult with privateData, signatories = [partyA, actor]
template PrivateResult
with
privateData : Text
signatories : [Party]
where
signatory signatories
test : Script PrivateResultId
test = script do
alice <- allocatePartyWithHint "Alice" (PartyIdHint "Alice")
bob <- allocatePartyWithHint "Bob" (PartyIdHint "Bob")
charlie <- allocatePartyWithHint "Charlie" (PartyIdHint "Charlie")
aliceTV <- submit alice do
createCmd PublicContract with
partyA = alice
parties = [bob, charlie]
submit bob do
exerciseCmd aliceTV PrivateChoice with actor = bob, privateData = "data"
Thanks!