ligo/src/client/client_blocks.ml
Grégoire Henry 3f5bd7ea5b Client: allow the baker te re-read keys.
Is a new key is added, the baker will start baking for this key.
No need to relauch the baker anymore.
2017-03-02 16:18:16 +01:00

29 lines
1.2 KiB
OCaml

(**************************************************************************)
(* *)
(* Copyright (c) 2014 - 2016. *)
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
(* *)
(* All rights reserved. No warranty, explicit or implicit, provided. *)
(* *)
(**************************************************************************)
let genesis =
Block_hash.of_b58check
"BLockGenesisGenesisGenesisGenesisGenesisGeneskvg68z"
let get_block_hash cctxt = function
| `Hash hash -> Lwt.return hash
| `Genesis | `Head _ | `Test_head _ as block ->
Client_node_rpcs.Blocks.hash cctxt block
| `Prevalidation -> Client_node_rpcs.Blocks.hash cctxt (`Head 0)
| `Test_prevalidation -> Client_node_rpcs.Blocks.hash cctxt (`Test_head 0)
let get_block_info cctxt block =
let block =
match block with
| `Prevalidation -> `Head 0
| `Test_prevalidation -> `Test_head 0
| b -> b in
Client_node_rpcs.Blocks.info cctxt block