-
Notifications
You must be signed in to change notification settings - Fork 199
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
JSON API Upgrades: ETX-500 require fully qualified template ids #19149
JSON API Upgrades: ETX-500 require fully qualified template ids #19149
Conversation
e112a7d
to
c4bd32e
Compare
529b27c
to
69f7fb5
Compare
@@ -66,6 +66,9 @@ object HttpServiceTestFixture extends LazyLogging with Assertions with Inside { | |||
|
|||
private val doNotReloadPackages = FiniteDuration(100, DAYS) | |||
|
|||
// This may need to be updated if the Account.daml is updated. | |||
val staticPkgIdAccount = "b3c9564bb7334bfd0f82099893eba518afc3b68a4d5c66cb2835498252db93e9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code does not currently depend on the integration-tests-lib, which reads current package ids of each package. The package ids are not expected to be updated often, but we help ensure this value is kept up-to-date with this assertion
https://github.com/digital-asset/daml/pull/19149/files?diff=split&w=1#diff-f3396356d430497a19c0ec5e05f9a95cb546414b908043c6037c70eb1d869eb3R76
) | ||
finalResult <- { | ||
val packageId = (x: C.RequiredPkg).packageId | ||
if (packageId.startsWith("#")) { // Used package name, not package id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The presence of a package name now has the same resolution logic that the absence of a package id had previously. The package ids that share this name may be updated on the ledger in the background, so we may need to dial back into the ledger to find out about the current set of package ids.
sdk/ledger-service/http-json/src/main/scala/com/digitalasset/http/ContractsService.scala
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
69f7fb5
to
4162716
Compare
We still need to distinguish package name vs package id at the point where we resolve contract type ids, so we keep the logic that we used on missing package id, and do the same thing in the case of a package name. This logic deals with the fact that new packages can get uploaded in the background, and so we need to be able to treat a package name as a dynamically late-bound mapping to specific package.