2018-01-16 01:09:25 +04:00
|
|
|
(**************************************************************************)
|
|
|
|
(* *)
|
|
|
|
(* Copyright (c) 2014 - 2016. *)
|
|
|
|
(* Dynamic Ledger Solutions, Inc. <contact@tezos.com> *)
|
|
|
|
(* *)
|
|
|
|
(* All rights reserved. No warranty, explicit or implicit, provided. *)
|
|
|
|
(* *)
|
|
|
|
(**************************************************************************)
|
|
|
|
|
2018-02-05 22:23:18 +04:00
|
|
|
open Proto_alpha
|
|
|
|
|
2018-01-16 01:09:25 +04:00
|
|
|
(** Representation of blocks independent from the State module *)
|
|
|
|
|
|
|
|
type shell_header = Block_header.shell_header
|
|
|
|
type tezos_header = Block_header.t
|
2018-02-16 17:05:46 +04:00
|
|
|
type protocol_data = Alpha_context.Block_header.protocol_data
|
2018-01-16 01:09:25 +04:00
|
|
|
type operation_header = Operation.shell_header
|
|
|
|
|
|
|
|
(** Block before application *)
|
|
|
|
type init_block = {
|
|
|
|
pred_block_hash : Block_hash.t;
|
|
|
|
pred_shell_header : shell_header;
|
2018-02-16 17:05:46 +04:00
|
|
|
protocol_data : protocol_data;
|
2018-01-16 01:09:25 +04:00
|
|
|
op_header : operation_header;
|
|
|
|
sourced_operations :
|
|
|
|
(Main.operation * Helpers_account.t) list;
|
|
|
|
operation_hashs : Operation_hash.t list;
|
2018-02-16 17:05:46 +04:00
|
|
|
protocol_data_bytes : MBytes.t;
|
2018-01-16 01:09:25 +04:00
|
|
|
timestamp : Time.t;
|
|
|
|
level : Int32.t;
|
2018-02-17 17:39:45 +04:00
|
|
|
context : Tezos_protocol_environment_memory.Context.t
|
2018-01-16 01:09:25 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
(** Result of the application of a block *)
|
|
|
|
type result = {
|
|
|
|
tezos_header : tezos_header;
|
|
|
|
hash : Block_hash.t;
|
|
|
|
level : Int32.t;
|
2018-02-17 17:39:45 +04:00
|
|
|
validation : Tezos_protocol_environment_memory.validation_result;
|
2018-02-11 22:17:39 +04:00
|
|
|
tezos_context : Alpha_context.t;
|
2018-01-16 01:09:25 +04:00
|
|
|
}
|
|
|
|
val get_op_header_res : result -> operation_header
|
2018-02-16 17:05:46 +04:00
|
|
|
val get_protocol_data : int -> protocol_data
|
2018-01-16 01:09:25 +04:00
|
|
|
val get_op_header : Block_hash.t -> operation_header
|
|
|
|
val make_sourced_operation :
|
|
|
|
Operation.shell_header ->
|
2018-02-11 22:17:39 +04:00
|
|
|
Alpha_context.proto_operation *
|
2018-01-16 01:09:25 +04:00
|
|
|
Helpers_account.t ->
|
2018-02-05 22:23:18 +04:00
|
|
|
((Proto_alpha.Main.operation * Helpers_account.t) * Operation_hash.t) proto_tzresult
|
2018-01-16 01:09:25 +04:00
|
|
|
val init :
|
|
|
|
shell_header -> Block_hash.t -> Int32.t -> int ->
|
2018-02-11 22:17:39 +04:00
|
|
|
(Alpha_context.proto_operation * Helpers_account.t) list ->
|
2018-02-05 22:23:18 +04:00
|
|
|
Context.t -> init_block proto_tzresult
|
2018-01-16 01:09:25 +04:00
|
|
|
val init_of_result :
|
|
|
|
?priority:int -> res:result ->
|
2018-02-11 22:17:39 +04:00
|
|
|
ops:(Alpha_context.proto_operation * Helpers_account.t) list ->
|
2018-02-05 22:23:18 +04:00
|
|
|
init_block proto_tzresult
|
2018-01-16 01:09:25 +04:00
|
|
|
val get_level : string option -> int32
|
|
|
|
val get_header_hash :
|
2018-02-17 17:39:45 +04:00
|
|
|
init_block -> Tezos_protocol_environment_memory.validation_result ->
|
2018-02-05 22:23:18 +04:00
|
|
|
result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val begin_construction_pre :
|
2018-02-05 22:23:18 +04:00
|
|
|
init_block -> Main.validation_state proto_tzresult Lwt.t
|
|
|
|
val make : init_block -> result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val make_init :
|
|
|
|
shell_header -> Block_hash.t -> Int32.t -> int ->
|
2018-02-11 22:17:39 +04:00
|
|
|
(Alpha_context.proto_operation * Helpers_account.t) list ->
|
2018-02-05 22:23:18 +04:00
|
|
|
Context.t -> result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val of_res :
|
|
|
|
?priority:int ->
|
2018-02-11 22:17:39 +04:00
|
|
|
?ops:(Alpha_context.proto_operation * Helpers_account.t) list ->
|
2018-01-16 01:09:25 +04:00
|
|
|
res:result ->
|
2018-02-05 22:23:18 +04:00
|
|
|
unit -> result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val endorsement :
|
|
|
|
shell_header -> Block_hash.t -> Int32.t -> int ->
|
2018-02-05 22:23:18 +04:00
|
|
|
Helpers_account.t -> Context.t -> int ->
|
|
|
|
result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val endorsement_of_res :
|
|
|
|
result -> Helpers_account.t -> int -> ?priority:int -> res:result ->
|
2018-02-05 22:23:18 +04:00
|
|
|
unit -> result proto_tzresult Lwt.t
|
2018-01-16 01:09:25 +04:00
|
|
|
val empty :
|
|
|
|
shell_header -> Block_hash.t -> Int32.t -> int ->
|
2018-02-05 22:23:18 +04:00
|
|
|
Context.t -> result proto_tzresult Lwt.t
|