alter lookupbykey return type to be optional#22894
Merged
roger-bosman-da merged 11 commits intomainfrom Apr 24, 2026
Merged
Conversation
f44da35 to
449165c
Compare
Contributor
Author
|
/azp run |
Contributor
|
Azure Pipelines successfully started running 1 pipeline(s). |
0297c1a to
9c78dc7
Compare
9c78dc7 to
418ea8d
Compare
7b04cd2 to
083e477
Compare
dylant-da
approved these changes
Apr 23, 2026
dylant-da
approved these changes
Apr 23, 2026
2f035b5 to
3e13fa8
Compare
roger-bosman-da
added a commit
that referenced
this pull request
Apr 24, 2026
backport of #22894 but with a 3.5.1 canton snapshot inside
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In theory,
damlccatches calls to lookupbykey with negative (yielding an error) or 0 (yielding the empty list[]) n. That being said, to accomodate handwritten LF and to be a bit more precies, we wrap thelookupbykeyin an optional, whereNoneindicates failiure (such as a n < 1).This PR implements the daml side of this change.
ULookupNByKeyto include an OptionallookupNByKeyto force the Optional, yielding an error if it is None (it should never be None when compiling with damlc, sincen < 1is already caught by the implementation oflookupNByKeylookupByKeycan uselookupNByKeyand does not have to repeat the fromOption`)Furthermore, since the change involves a change to the daml-lf json, the golden check was uncommented as well.
Canton companion PR: https://github.com/DACH-NY/canton/pull/32018
GHC companion PR: digital-asset/ghc#193
Steps taken: