Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contract key are mistakenly deleted for nonconsuming choices within transaction #973

Closed
bitonic opened this issue May 7, 2019 · 0 comments
Labels
broken Product is broken and must be fixed component/daml-lf DAML-LF
Milestone

Comments

@bitonic
Copy link
Contributor

bitonic commented May 7, 2019

Right now the following does not work:

template Foo
  with
    p : Party
  where
    signatory p
    maintainer p
    key p : Party

    controller p can
      nonconsuming DoNothing: ()
        do return ()

template Boo
  with
    p : Party
  where
    signatory p
    controller p can
      Fetch: (ContractId Foo)
        do
          fooCid <- fmap fst $ fetchByKey @Foo p
          exercise fooCid DoNothing
          fmap fst $ fetchByKey @Foo p

test = scenario do
  p <- getParty "Party"
  submit p do create Foo with p
  submit p do
    booCid <- create Boo with p
    exercise booCid Fetch

that is, the second fetchByKey in choice Fetch fails. this is due to the fact that we record contract key deletions locally without considering whether the choice is consuming or not, see

.

@bitonic bitonic added broken Product is broken and must be fixed component/daml-lf DAML-LF labels May 7, 2019
@bitonic bitonic added this to the Maintenance milestone May 7, 2019
@bitonic bitonic closed this as completed in bb6f213 May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken Product is broken and must be fixed component/daml-lf DAML-LF
Projects
None yet
Development

No branches or pull requests

1 participant