Hi!
It seems the transaction view in Daml VSCode extension shows something that conflicts with the documentation here.
According to the documentation, “if the fetch appears in an update block of a choice ch on a contract c1, and the fetched contract ID resolves to a contract c2, then the actors are defined as the intersection of (1) the signatories of c1 union the controllers of ch with (2) the stakeholders of c2.”
However, my transaction view shows a fetch actor who is not in that intersection.
I’m trying to reproduce this example, with the following templates and test script:
template Iou
with
bank: Party
owner: Party
where
signatory bank
observer owner
template ShowIou
with
owner: Party
painter: Party
where
signatory owner
observer painter
choice ShowToPainter: Iou
with
iouID: ContractId Iou
controller owner
do fetch iouID
iou <- submit bank do
createCmd Iou with
bank = bank
owner = alice
submit alice do
createAndExerciseCmd (ShowIou alice painter) ShowToPainter with iouID = iou
The transaction view shows the following:
Transactions:
TX 0 1970-01-01T00:00:00Z (Main:223:10)
#0:0
│ referenced by #1:2
│ disclosed to (since): 'Alice' (0), 'Bank' (0)
│ divulged to (since): 'Painter' (1)
└─> 'Bank' creates Main:Iou
with
bank = 'Bank'; owner = 'Alice'
TX 1 1970-01-01T00:00:00Z (Main:228:3)
#1:0
│ consumed by: #1:1
│ referenced by #1:1
│ disclosed to (since): 'Alice' (1), 'Painter' (1)
└─> 'Alice' creates Main:ShowIou
with
owner = 'Alice'; painter = 'Painter'
#1:1
│ disclosed to (since): 'Alice' (1), 'Painter' (1)
└─> 'Alice' exercises ShowToPainter on #1:0 (Main:ShowIou)
with
iouID = #0:0
children:
#1:2
│ disclosed to (since): 'Alice' (1), 'Painter' (1), 'Bank' (1)
└─> 'Bank' fetches #0:0 (Main:Iou)
My concern is the last line in the transaction view, because according to the documentation, the expected actor should be ‘Alice’ (who is both the controller of ShowToPainter and stakeholder of iou), however, the actual actor is ‘Bank’ as shown above.
Could anyone explain what I’m missing or is this a bug in the SDK? Thanks a lot!