-
Notifications
You must be signed in to change notification settings - Fork 205
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
extractor: use daml-lf transaction Value ADT instead of bespoke ADT #1117
Conversation
…r-use-transaction-value-adt
- JSON object ordering now matches record field order, instead of being its reverse - Includes a new encoding for records missing labels, to a list of 2-tuples
…r-use-transaction-value-adt
- JSON date/time is just <num>s since epoch, maybe revisit
…r-use-transaction-value-adt
Encoder[String].contramap(identity) | ||
|
||
// TODO SC this matches the prior behavior of JSON-ing the dates and timestamps | ||
// as days-since and micros-since epoch, but maybe we'd like something else? |
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.
cc @bitonic @remyhaemmerle-da @leo-da for JSON-pinions
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.
Yes, i think we should change this to use string representations, as we did with the old JSON-through-LfTypeEncoding. Feel free to change this in the next PR though.
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.
Looks good
daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/ImmArray.scala
Outdated
Show resolved
Hide resolved
extractor/src/main/scala/com/digitalasset/extractor/json/JsonConverters.scala
Show resolved
Hide resolved
extractor/src/main/scala/com/digitalasset/extractor/ledger/types/LedgerValue.scala
Outdated
Show resolved
Hide resolved
@@ -269,54 +268,52 @@ object Queries { | |||
|
|||
private def toFragmentNullable(valueSum: LedgerValue): Fragment = { | |||
valueSum match { | |||
case LedgerValue.Optional(None) => Fragment.const("NULL") | |||
case LedgerValue.Optional(Some(innerVal)) => toFragment(innerVal) | |||
case V.ValueOptional(None) => Fragment.const("NULL") |
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 can be a constant, don't know if Fragment.const
is actually heavy or not.
…r-use-transaction-value-adt
…r-use-transaction-value-adt
extractor uses its own
LedgerValue
ADT as a pivot from the ledger-api Value type; instead, we should recycle theValue
ADT fromdaml-lf/transaction
library. This rewrites all the codecs and things to use that ADT instead, with some behavioral changes informed by the new ADT, such as proper handling of missing record field labels.Pull Request Checklist
NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.