package octez-protocol-alpha-libs
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
sha256=dbc3b675aee59c2c574e5d0a771193a2ecfca31e7a5bc5aed66598080596ce1c
    
    
  sha512=b97ed762b9d24744305c358af0d20f394376b64bfdd758dd4a81775326caf445caa57c4f6445da3dd6468ff492de18e4c14af6f374dfcbb7e4d64b7b720e5e2a
    
    
  doc/octez-protocol-alpha-libs.baking/Tezos_baking_alpha/Baking_simulator/index.html
Module Tezos_baking_alpha.Baking_simulatorSource
type incremental = {- predecessor : Baking_state.block_info;
- context : Tezos_protocol_environment.Context.t;
- state : Tezos_protocol_alpha.Protocol.validation_state * Tezos_protocol_alpha.Protocol.application_state option;
- rev_operations : Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed list;
- header : Tezos_base.Block_header.shell_header;
}val load_context : 
  context_path:string ->
  Abstract_context_index.t Tezos_base.TzPervasives.tzresult Lwt.tval check_context_consistency : 
  Abstract_context_index.t ->
  Tezos_base.TzPervasives.Context_hash.t ->
  unit Tezos_base.TzPervasives.tzresult Lwt.tMake sure that the given context is consistent by trying to read in it
val begin_construction : 
  timestamp:Tezos_base.TzPervasives.Time.Protocol.t ->
  protocol_data:Tezos_protocol_alpha.Protocol.block_header_data ->
  force_apply:bool ->
  pred_resulting_context_hash:Tezos_base.TzPervasives.Context_hash.t ->
  Abstract_context_index.t ->
  Baking_state.block_info ->
  Tezos_base.TzPervasives.Chain_id.t ->
  incremental Tezos_base.TzPervasives.tzresult Lwt.tbegin_construction ~timestamp ~protocol_data ~force_apply abstract_context predecessor chain_id creates a new incremental value with an empty operation list. A context is recovered from the abstract_index and the resulting_context_hash from predecessor. This context is used to create a validation_state and an application_state (if force_apply is set). A partial shell_header is created from predecessor information and timestamp.
val add_operation : 
  incremental ->
  Tezos_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
  (incremental * Tezos_protocol_alpha.Protocol.operation_receipt option)
    Tezos_base.TzPervasives.tzresult
    Lwt.tadd_operation incremental op validates op in incremental.validation_state without checking its signature. Indeed, the operation has already been validated in the node so it has a correct signature. We still need to validate it again because the context may be different. op is also applied if incremental has been created with force_apply set. This function returns an incremental with updated operations list and validation_state (and application_state).
val finalize_construction : 
  incremental ->
  (Tezos_protocol_environment.validation_result
   * Tezos_protocol_alpha.Protocol.block_header_metadata)
    option
    Tezos_base.TzPervasives.tzresult
    Lwt.tfinalize_construction incremental calls the finalize_validation of the protocol on the validation_state from incremental. If incremental has been created with force_apply set, finalize_application is also called and its results returned.