diff --git a/src/lib_base/fitness.ml b/src/lib_base/fitness.ml index 7bf88ca35..002a9a83f 100644 --- a/src/lib_base/fitness.ml +++ b/src/lib_base/fitness.ml @@ -54,8 +54,11 @@ let encoding = let open Data_encoding in def "fitness" ~title: "Fitness" - ~description: "... FIXME ..." - (list (def "fitness.elem" bytes)) + ~description: "... FIXME ..." @@ + splitted + ~json: (list bytes) + ~binary: + (list (def "fitness.elem" bytes)) let to_bytes v = Data_encoding.Binary.to_bytes_exn encoding v let of_bytes b = Data_encoding.Binary.of_bytes encoding b diff --git a/src/lib_crypto/helpers.ml b/src/lib_crypto/helpers.ml index 4c0094d8e..705258b78 100644 --- a/src/lib_crypto/helpers.ml +++ b/src/lib_crypto/helpers.ml @@ -101,7 +101,7 @@ module MakeEncoder(H : sig let open Data_encoding in splitted ~binary: - H.raw_encoding + (obj1 (req H.name H.raw_encoding)) ~json: (def H.name ~title: (H.title ^ " (Base58Check-encoded)") @@ diff --git a/src/lib_data_encoding/binary_description.ml b/src/lib_data_encoding/binary_description.ml index c8538c3fe..07c25693e 100644 --- a/src/lib_data_encoding/binary_description.ml +++ b/src/lib_data_encoding/binary_description.ml @@ -215,8 +215,8 @@ let describe (type x) (encoding : x Encoding.t) = and obj fields = Binary_schema.Obj { fields } and union : - type a. recursives -> references -> Kind.t -> Binary_size.tag_size -> a case list -> string * references= - fun recursives references kind size cases -> + type a. string option -> recursives -> references -> Kind.t -> Binary_size.tag_size -> a case list -> string * references= + fun ref_name recursives references kind size cases -> let cases = List.sort (fun (t1, _) (t2, _) -> Compare.Int.compare t1 t2) @@ TzList.filter_map @@ -233,7 +233,7 @@ let describe (type x) (encoding : x Encoding.t) = ((tag, Some case.title, tag_field :: fields) :: cases, references)) cases ([], references) in - let name = new_reference () in + let name = may_new_reference ref_name in let references = add_reference name @@ -327,7 +327,7 @@ let describe (type x) (encoding : x Encoding.t) = fields None recursives references right.encoding in (fields1 @ fields2, references) | Union { kind ; tag_size ; cases } -> - let name, references = union recursives references kind tag_size cases in + let name, references = union None recursives references kind tag_size cases in ([ Anonymous_field (kind, Ref name) ], references) | (Mu { kind ; name ; title ; description ; fix } as encoding) -> let kind = (kind :> Kind.t) in @@ -459,8 +459,7 @@ let describe (type x) (encoding : x Encoding.t) = let references = add_reference name (obj fields) references in (Ref name, references) | Union { kind ; tag_size ; cases } -> - (* FIXMe ref_name ?? *) - let name, references = union recursives references kind tag_size cases in + let name, references = union ref_name recursives references kind tag_size cases in (Ref name, references) | Mu { name ; title ; description ; fix } as encoding -> let title = Option.unopt ~default:name title in diff --git a/src/proto_alpha/lib_protocol/src/operation_repr.ml b/src/proto_alpha/lib_protocol/src/operation_repr.ml index 1f9746b95..c0755c6fb 100644 --- a/src/proto_alpha/lib_protocol/src/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/src/operation_repr.ml @@ -335,6 +335,7 @@ module Encoding = struct | Single o -> o in let of_list : Kind.endorsements contents -> _ = function | o -> Single o in + def "inlined.endorsement" @@ conv (fun ({ shell ; protocol_data = { contents ; signature } } : _ operation)-> (shell, (contents, signature))) @@ -345,6 +346,7 @@ module Encoding = struct (obj2 (req "operations" (conv to_list of_list @@ + def "inlined.endorsement.contents" @@ union [ make endorsement_case ; ]))