Skip to content

Commit

Permalink
Merge #1797
Browse files Browse the repository at this point in the history
1797: rework JSON conversions for transaction metadata r=dcoutts a=KtorZ

  a. Encode JSON as CBOR considering only the following "optimizations"
  b. Hexadecimal sequences starting with 0x are encoded as CBOR bytestring.
  c. JSON keys that are numbers are encoded as CBOR numbers.
  d. CBOR is shown as JSON when possible, or as a string representing JSON-encoded data when not (i.e. when map keys aren't numbers or strings).
  e. CBOR bytestrings are represented as hexadecimal strings prefixed with 0x

  - we expect are that we can round trip any JSON without constraints (modulo null and boolean values)
  - for CBOR, we should be able to round trip a subset with some simple-ish constraints.

Co-authored-by: Duncan Coutts <duncan@well-typed.com>
  • Loading branch information
iohk-bors[bot] and dcoutts committed Sep 16, 2020
2 parents 9bce1d4 + a75c650 commit 2ef9e7a
Show file tree
Hide file tree
Showing 8 changed files with 852 additions and 312 deletions.
2 changes: 1 addition & 1 deletion .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
# Ignore some builtin hints
# - ignore: {name: Use let}
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules

- ignore: {name: "Use lambda-case"}

# Define some custom infix operators
# - fixity: infixr 3 ~^#^~
Expand Down
1 change: 1 addition & 0 deletions cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ test-suite cardano-api-test
build-depends:
base >=4.12 && <5
, aeson
, base16-bytestring
, bytestring
, cardano-api
, cardano-binary
Expand Down

0 comments on commit 2ef9e7a

Please sign in to comment.