package tezos-shell

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Legacy_prevalidation.MakeSource

How-to obtain an instance of this module's main module type: T

Parameters

Signature

Sourcetype protocol_operation = Proto.operation

Similar to the same type in the protocol, see Tezos_protocol_environment.PROTOCOL.operation

Sourcetype operation_receipt = Proto.operation_receipt

Similar to the same type in the protocol, see Tezos_protocol_environment.PROTOCOL

Sourcetype validation_state = Proto.validation_state

Similar to the same type in the protocol, see Tezos_protocol_environment.PROTOCOL

Sourcetype chain_store = Tezos_store.Store.chain_store

The type implemented by Tezos_store.Store.chain_store in production, and mocked in tests

Sourcetype t

The type used internally by this module. Created by create and then passed back and possibly updated by apply_operation.

Sourceval parse : Tezos_base.TzPervasives.Operation_hash.t -> Tezos_base.Operation.t -> protocol_operation operation Tezos_base.TzPervasives.tzresult

parse hash op reads a usual Operation.t and lifts it to the type protocol_operation used by this module. This function is in the tzresult monad, because it can return the following errors:

  • Validation_errors.Oversized_operation if the size of the operation data within op is too large (to protect against DoS attacks), and
  • Validation_errors.Parse_error if serialized data cannot be parsed.
Sourceval increment_successful_precheck : protocol_operation operation -> protocol_operation operation

increment_successful_precheck op increments the field count_successful_prechecks of the given operation op. It is supposed to be called after each successful precheck of a given operation op, and nowhere else. Overflow is unlikely to occur in practice, as the counter grows very slowly and the number of prechecks is bounded.

Sourceval create : chain_store -> predecessor:Tezos_store.Store.Block.t -> live_operations:Tezos_base.TzPervasives.Operation_hash.Set.t -> timestamp:Tezos_base.Time.Protocol.t -> unit -> t Tezos_base.TzPervasives.tzresult Lwt.t

Creates a new prevalidation context w.r.t. the protocol associated with the predecessor block.

Values returned by create. They are obtained from the result of the protocol apply_operation function and the classification of errors.

Sourceval apply_operation : t -> protocol_operation operation -> result Lwt.t

apply_operation t op calls the protocol apply_operation function and handles possible errors, hereby yielding a classification

Sourceval validation_state : t -> validation_state

validation_state t returns the subset of t corresponding to the type validation_state of the protocol.

Sourceval set_validation_state : t -> validation_state -> t

Updates the subset of t corresponding to the type validation_state of the protocol.

Sourceval pp_result : Format.formatter -> result -> unit
Sourcemodule Internal_for_tests : sig ... end
OCaml

Innovation. Community. Security.