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

Comments

Projects
None yet
1 participant
@bitonic
Copy link
Contributor

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

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.