2016-09-08 21:13:10 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
|
|
|
open Tezos_hash
|
|
|
|
|
|
|
|
(** Exported type *)
|
|
|
|
type header = {
|
2016-10-19 22:47:04 +04:00
|
|
|
shell: Updater.shell_block ;
|
2016-09-08 21:13:10 +04:00
|
|
|
proto: proto_header ;
|
2017-02-28 05:56:40 +04:00
|
|
|
signature: Ed25519.Signature.t ;
|
2016-09-08 21:13:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
and proto_header = {
|
|
|
|
mining_slot: mining_slot ;
|
|
|
|
seed_nonce_hash: Nonce_hash.t ;
|
|
|
|
proof_of_work_nonce: MBytes.t ;
|
|
|
|
}
|
|
|
|
|
|
|
|
and mining_slot = Raw_level_repr.t * Int32.t
|
|
|
|
|
|
|
|
val mining_slot_encoding: mining_slot Data_encoding.encoding
|
|
|
|
|
|
|
|
(** The maximum size of block headers in bytes *)
|
|
|
|
val max_header_length: int
|
|
|
|
|
|
|
|
(** Parse the protocol-specific part of a block header. *)
|
2016-10-19 22:47:04 +04:00
|
|
|
val parse_header: Updater.raw_block -> header tzresult
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val unsigned_header_encoding:
|
2016-10-19 22:47:04 +04:00
|
|
|
(Updater.shell_block * proto_header) Data_encoding.encoding
|
2016-09-08 21:13:10 +04:00
|
|
|
|
|
|
|
val forge_header:
|
2016-10-19 22:47:04 +04:00
|
|
|
Updater.shell_block -> proto_header -> MBytes.t
|
2016-09-08 21:13:10 +04:00
|
|
|
|