Client/Baker: improve logging.

This commit is contained in:
Grégoire Henry 2017-02-14 12:24:56 +01:00
parent f77a2544cc
commit 9a0ac6b837

View File

@ -27,13 +27,19 @@ type Error_monad.error += Bad_revelation
let forge_seed_nonce_revelation
(cctxt: Client_commands.context)
block ?(force = false) nonces =
Client_node_rpcs.Blocks.hash cctxt block >>= fun hash ->
match nonces with
| [] ->
cctxt.message "No nonce to reveal" >>= fun () ->
cctxt.message "No nonce to reveal for block %a"
Block_hash.pp_short hash >>= fun () ->
return ()
| _ ->
inject_seed_nonce_revelation cctxt
block ~force ~wait:true nonces >>=? fun oph ->
cctxt.answer "Operation successfully injected in the node." >>= fun () ->
cctxt.answer "Operation hash is '%a'." Operation_hash.pp_short oph >>= fun () ->
cctxt.answer
"Operation successfully injected %d revelation(s) for %a."
(List.length nonces)
Block_hash.pp_short hash >>= fun () ->
cctxt.answer "Operation hash is '%a'."
Operation_hash.pp_short oph >>= fun () ->
return ()