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

ExerciseByKey command issue with upgraded keys #19782

Open
paulbrauner-da opened this issue Aug 14, 2024 · 1 comment
Open

ExerciseByKey command issue with upgraded keys #19782

paulbrauner-da opened this issue Aug 14, 2024 · 1 comment
Assignees

Comments

@paulbrauner-da
Copy link
Contributor

paulbrauner-da commented Aug 14, 2024

ExerciseByKey command nodes don't store the upgraded key. This leads to re-intepretation errors.

exerciseCmdKeyUnchanged : Test
exerciseCmdKeyUnchanged = test $ do
  a <- allocateParty "alice"
  cid <- a `submit` createExactCmd (V1.UnchangedKey a 1)
  res <- a `submit` exerciseByKeyExactCmd @V2.UnchangedKey (V2.UnchangedKeyKey a 1) V2.UnchangedKeyCall
  res === "V2"

Fails with

│  Preprocessing(                                                                                                                                                                                                                                                                 │
│    TypeMismatch(                                                                                                                                                                                                                                                                │
│      TTyCon(Identifier("f16528e38f4dad82de8c92f2ab7ec3ed6810e5630f5a0dac915e4476c572deb6", QualifiedName(UpgradedContractKeys, UpgradedKeyKey))),                                                                                                                               │
│      ValueRecord(None, ImmArray((None,ValueParty(party-16780f11-e4e6-4817-8a99-3b891d022d19::1220072f530858469e83cf46f8015492a98a683f5df9761a790247a98f3dd8849651)),(None,ValueInt64(1)))),                                                                                     │
│      "Expecting 3 field for record f16528e38f4dad82de8c92f2ab7ec3ed6810e5630f5a0dac915e4476c572deb6:UpgradedContractKeys:UpgradedKeyKey, but got 2"                                                                                                                             │
│    )                                                                                                                                                                                                                                                                            │
│  ),                                                                                                                                                                                                                                                                             │
│  ViewHash(SHA-256:2f239a71d77b...)                                                                                                                                                                                                                                              │
│) err-context:{location=ConfirmationResponseFactory.scala:204, requestId=RequestId(2024-08-14T12:01:48.331102Z)}  

In ModelConformanceChecker.

@dylant-da
Copy link
Contributor

Still needs to be fixed for 3.x
2.x's solution was a hack, a proper solution is needed for 3.x so we can't just forwardport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants