From 86091e98c6898f2e84382a9f436dff48ed5a205b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Henry?= Date: Wed, 18 Jul 2018 20:21:23 +0200 Subject: [PATCH] Baker: use `next_protocols` when calling `GET /monitor/heads` --- src/proto_alpha/lib_delegate/client_baking_blocks.ml | 2 +- src/proto_alpha/lib_delegate/client_baking_blocks.mli | 2 +- src/proto_alpha/lib_delegate/client_daemon.ml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/proto_alpha/lib_delegate/client_baking_blocks.ml b/src/proto_alpha/lib_delegate/client_baking_blocks.ml index fba0106fa..c241d9cbf 100644 --- a/src/proto_alpha/lib_delegate/client_baking_blocks.ml +++ b/src/proto_alpha/lib_delegate/client_baking_blocks.ml @@ -69,7 +69,7 @@ let monitor_valid_blocks cctxt ?chains ?protocols ?next_protocols () = raw_info cctxt ~chain:(`Hash chain) block shell) block_stream) -let monitor_heads cctxt ?next_protocols chain = +let monitor_heads cctxt ~next_protocols chain = Monitor_services.heads cctxt ?next_protocols chain >>=? fun (block_stream, _stop) -> return (Lwt_stream.map_s diff --git a/src/proto_alpha/lib_delegate/client_baking_blocks.mli b/src/proto_alpha/lib_delegate/client_baking_blocks.mli index 32a190299..5f11d99a0 100644 --- a/src/proto_alpha/lib_delegate/client_baking_blocks.mli +++ b/src/proto_alpha/lib_delegate/client_baking_blocks.mli @@ -54,7 +54,7 @@ val monitor_valid_blocks: val monitor_heads: #Proto_alpha.rpc_context -> - ?next_protocols:Protocol_hash.t list -> + next_protocols:Protocol_hash.t list option -> Chain_services.chain -> block_info tzresult Lwt_stream.t tzresult Lwt.t diff --git a/src/proto_alpha/lib_delegate/client_daemon.ml b/src/proto_alpha/lib_delegate/client_daemon.ml index 8fa705583..32312bafa 100644 --- a/src/proto_alpha/lib_delegate/client_daemon.ml +++ b/src/proto_alpha/lib_delegate/client_daemon.ml @@ -27,6 +27,7 @@ module Endorser = struct let run (cctxt : #Proto_alpha.full) ~delay ?min_date delegates = Client_baking_blocks.monitor_heads + ~next_protocols:(Some [Proto_alpha.hash]) cctxt `Main >>=? fun block_stream -> Client_baking_endorsement.create cctxt ~delay delegates block_stream >>=? fun () -> ignore min_date; @@ -38,6 +39,7 @@ module Baker = struct let run (cctxt : #Proto_alpha.full) ?threshold ?max_priority ?min_date ~context_path delegates = Client_baking_blocks.monitor_heads + ~next_protocols:(Some [Proto_alpha.hash]) cctxt `Main >>=? fun block_stream -> Client_baking_forge.create cctxt ?threshold ?max_priority ~context_path delegates block_stream >>=? fun () ->