forked from digital-asset/daml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change variant JSON encoding, so it is easier to pattern match on it …
…in TypeScript (digital-asset#3882) * Change variant json encoding, adding integration test * Add DamlLfTypeLookup dependencies * Add MetadataReader * Add test WIP * Add serialize test cases * Add serialize test cases, WIP * Test for variant encoding decoding * Solving merge conflicts * Updating roundtrip test * Minor cleanup * Addressing code review comments Add JsonVariant custom matcher * Update specification * Update link * Add test case, WIP * Add proper template key resolution * Got rid of choice record ID resolution, resolving choice type and key type * Fixing logging * Add Contract Key decoding tests * cleanup * cleanup * Update JSON variant encoding tests * Add more contract key JSON decoding tests * Fix variant JSON encoding * Change value predicate to support new variant encoding * Change value predicate to support new variant encoding * Add lookup by contract key test case where contract key contains variant and record Add `requiredResource` to bazel utils CHANGELOG_BEGIN - [JSON API - Experimental] Change variant JSON encoding. The new format is ``{ tag: data-constructor, value: argument }``. For example, if we have: ``data Foo = Bar Int | Baz``, these are all valid JSON encodings for values of type Foo: - ``{"tag": "Bar", "value": 42}`` - ``{"tag": "Baz", "value": {}}`` See digital-asset#3622 - [JSON API - Experimental] Fix ``/contracts/lookup` find by contract key. - [JSON API - Experimental] Fix ``/command/exercise`` to support any LF type as a choice argument. See digital-asset#3390 CHANGELOG_END * minor cleanup * Fix copy/paste * Renaming * Got rid of DAML LF identifier resolution resolving DAML LF Type based on command type * Address code review comments, thanks @S11001001 * Address code review comments, thanks @S11001001 Do not include any error handling here; this partial function should only match the successful case, JsonVariant. * Address code review comments, thanks @S11001001 comment * Address code review comments, thanks @S11001001 using `JsonVariant` for variant encoding/decoding * Address code review comments, thanks @S11001001 replace `find` and `map` chain with collectFirst * Update docs/source/json-api/lf-value-specification.rst Co-Authored-By: Stephen Compall <stephen.compall@daml.com> Co-authored-by: Stephen Compall <scompall@nocandysw.com>
- Loading branch information
1 parent
1794d8a
commit f22d52a
Showing
32 changed files
with
659 additions
and
172 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.