In the following code Transfer1
transaction graph doesn’t have an archive node, while Transfer2
transaction graph does. Why the difference?
module Main where
import Daml.Script
template Asset
with
owner : Party
where
signatory owner
choice Transfer1 : ContractId Asset
controller owner
do
create this
nonconsuming choice Transfer2 : ContractId Asset
controller owner
do
archive self
create this
demo = script do
alice <- allocateParty "Alice"
asset1 <- submit alice do
createCmd Asset with owner = alice
asset2 <- submit alice do
exerciseCmd asset1 Transfer1
asset3 <- submit alice do
exerciseCmd asset2 Transfer2
return ()
Transaction graph:
Show table viewTransactions:
TX 0 1970-01-01T00:00:00Z (Main:26:13)
#0:0
│ consumed by: #1:0
│ referenced by #1:0
│ known to (since): 'Alice' (0)
└─> create Main:Asset
with
owner = 'Alice'
TX 1 1970-01-01T00:00:00Z (Main:29:13)
#1:0
│ known to (since): 'Alice' (1)
└─> 'Alice' exercises Transfer1 on #0:0 (Main:Asset)
with
children:
#1:1
│ consumed by: #2:1
│ referenced by #2:0, #2:1
│ known to (since): 'Alice' (1)
└─> create Main:Asset
with
owner = 'Alice'
TX 2 1970-01-01T00:00:00Z (Main:32:13)
#2:0
│ known to (since): 'Alice' (2)
└─> 'Alice' exercises Transfer2 on #1:1 (Main:Asset)
with
children:
#2:1
│ known to (since): 'Alice' (2)
└─> 'Alice' exercises Archive on #1:1 (Main:Asset)
with
#2:2
│ known to (since): 'Alice' (2)
└─> create Main:Asset
with
owner = 'Alice'
Active contracts: #2:2
Return value: {}