digital-asset / contingent-claims

Apache License 2.0
5 stars 0 forks source link

`When` is removed incorrectly during `lifecycle` #47

Closed matteolimberto-da closed 2 years ago

matteolimberto-da commented 2 years ago

Given, t1 < t2, we consider the contract When( at(t1) ){ Scale( spot ){ When ( at(t2) ) { One USD } } } where spot is an observable that can be evaluated at a time t.

Invoking Lifecycle.lifecycle claim t1 yields Scale( spot ){ When ( at(t2) ) { One USD } } instead of the original contract.

An example of this behaviour can be found in https://github.com/digital-asset/contingent-claims/blob/frn-test/test/daml/Test/Lifecycle.daml#L325

lucianojoublanc-da commented 2 years ago

I think you're right. This is a bug.

https://github.com/digital-asset/contingent-claims/blob/7a2247341b04bb30f887c861890151fcd6a67f15/daml/ContingentClaims/Lifecycle.daml#L77-L80

Note the "consumes ..." :disappointed:

I'll look into this.