From ec7eeaaa0e2798f668d6b7dca8d04ae19c16faf4 Mon Sep 17 00:00:00 2001 From: Milo Davis Date: Thu, 26 Apr 2018 14:32:50 -0400 Subject: [PATCH] Client: describe unsigned data commands --- .../client_proto_context_commands.ml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml index 0b88aa7da..b1da52c4d 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml @@ -48,6 +48,10 @@ let alphanet = { Clic.name = "alphanet" ; title = "Alphanet only commands" } +let binary_description = + { Clic.name = "description" ; + title = "Binary Description" } + let commands () = let open Clic in [ @@ -369,4 +373,28 @@ let commands () = return () end ; + command ~group:binary_description ~desc:"Describe unsigned block header" + no_options + (fixed [ "describe" ; "unsigned" ; "block" ; "header" ]) + begin fun () (cctxt : Proto_alpha.full) -> + cctxt#message "%a" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe + ~toplevel_name:"Unsigned block header" + (Alpha_context.Block_header.unsigned_encoding)) >>= fun () -> + return () + end ; + + command ~group:binary_description ~desc:"Describe unsigned block header" + no_options + (fixed [ "describe" ; "unsigned" ; "operation" ]) + begin fun () (cctxt : Proto_alpha.full) -> + cctxt#message "%a" + Data_encoding.Binary_schema.pp + (Data_encoding.Binary.describe + ~toplevel_name:"Unsigned operation" + Alpha_context.Operation.unsigned_encoding) >>= fun () -> + return () + end + ]