G-d willing
Hello guys,
I have the following code:
template A
with
owner : Party
id : Int
value : Int
something : Text
where
signatory owner
choice DoSomething: ContractId A
controller owner
do
create this with value = 10
The DoSomething
choice basically archives the previous version of its own.
However, when looking at the TransactionTree
I cannot see the archived version.
I am trying to check that using the following script:
testDoSomething : Script ()
testDoSomething = script do
alice <- allocateParty "alice"
a <- submit alice do
createCmd A with owner = alice, id = 1, value = 1, something = "Some Text"
TransactionTree{rootEvents = [ExercisedEvent Exercised{contractId, choice,
childEvents = [CreatedEvent created]
}]} <-
submitTree alice do
exerciseCmd a DoSomething
debug $ fromAnyTemplate @A created.argument
pure ()
I expected to get more from in the transaction tree. For example, when I tried to do:
TransactionTree{rootEvents = [ExercisedEvent Exercised{contractId, choice,
childEvents = [CreatedEvent created, ExercisedEvent archived]
}]} <-
submitTree alice do
exerciseCmd a DoSomething
But this code fails since there is no ExercisedEvent
in the return value.
So, how can I get the archived contract that happened during the exercise of DoSomething
?
Thanks,