package tezos-protocol-011-PtHangz2

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

Tezos Protocol Implementation - Low level Repr. of Operations

Defines kinds of operations that can be performed on chain:

  • endorsement (should now always be wrapped in endorsement_with_slot)
  • endorsement_with_slot
  • double endorsement evidence
  • seed nonce revelation
  • double baking evidence
  • account activation
  • proposal (see: Voting_repr)
  • ballot (see: Voting_repr)
  • failing noop
  • manager operation (which in turn has several types):
  • revelation
  • transaction
  • origination
  • delegation

Each of them can be encoded as raw bytes. Operations are distinguished at type level using phantom type parameters. packed_operation type allows for unifying them when required, for instance to put them on a single list.

module Kind : sig ... end
type raw = Tezos_base.Operation.t = {
  1. shell : Tezos_base.Operation.shell_header;
  2. proto : bytes;
}
val raw_encoding : raw Data_encoding.t
type 'kind operation = {
  1. shell : Tezos_base.Operation.shell_header;
  2. protocol_data : 'kind protocol_data;
}
and 'kind protocol_data = {
  1. contents : 'kind contents_list;
  2. signature : Tezos_crypto.Signature.t option;
}
and _ contents_list =
  1. | Single : 'kind contents -> 'kind contents_list
  2. | Cons : 'kind Kind.manager contents * 'rest Kind.manager contents_list -> ('kind * 'rest) Kind.manager contents_list
and _ contents =
  1. | Endorsement : {
    1. level : Raw_level_repr.t;
    } -> Kind.endorsement contents
  2. | Seed_nonce_revelation : {
    1. level : Raw_level_repr.t;
    2. nonce : Seed_repr.nonce;
    } -> Kind.seed_nonce_revelation contents
  3. | Endorsement_with_slot : {
    1. endorsement : Kind.endorsement operation;
    2. slot : int;
    } -> Kind.endorsement_with_slot contents
  4. | Double_endorsement_evidence : {
    1. op1 : Kind.endorsement operation;
    2. op2 : Kind.endorsement operation;
    3. slot : int;
    } -> Kind.double_endorsement_evidence contents
  5. | Double_baking_evidence : {
    1. bh1 : Block_header_repr.t;
    2. bh2 : Block_header_repr.t;
    } -> Kind.double_baking_evidence contents
  6. | Activate_account : {
    1. id : Tezos_crypto.Ed25519.Public_key_hash.t;
    2. activation_code : Blinded_public_key_hash.activation_code;
    } -> Kind.activate_account contents
  7. | Proposals : {
    1. source : Tezos_crypto.Signature.public_key_hash;
    2. period : int32;
    3. proposals : Tezos_crypto.Protocol_hash.t list;
    } -> Kind.proposals contents
  8. | Ballot : {
    1. source : Tezos_crypto.Signature.public_key_hash;
    2. period : int32;
    3. proposal : Tezos_crypto.Protocol_hash.t;
    4. ballot : Vote_repr.ballot;
    } -> Kind.ballot contents
  9. | Failing_noop : string -> Kind.failing_noop contents
  10. | Manager_operation : {
    1. source : Tezos_crypto.Signature.public_key_hash;
    2. fee : Tez_repr.tez;
    3. counter : counter;
    4. operation : 'kind manager_operation;
    5. gas_limit : Gas_limit_repr.Arith.integral;
    6. storage_limit : Z.t;
    } -> 'kind Kind.manager contents
and _ manager_operation =
  1. | Reveal : Tezos_crypto.Signature.public_key -> Kind.reveal manager_operation
  2. | Transaction : {
    1. amount : Tez_repr.tez;
    2. parameters : Script_repr.lazy_expr;
    3. entrypoint : string;
    4. destination : Contract_repr.contract;
    } -> Kind.transaction manager_operation
  3. | Origination : {
    1. delegate : Tezos_crypto.Signature.public_key_hash option;
    2. script : Script_repr.t;
    3. credit : Tez_repr.tez;
    4. preorigination : Contract_repr.t option;
    } -> Kind.origination manager_operation
  4. | Delegation : Tezos_crypto.Signature.public_key_hash option -> Kind.delegation manager_operation
  5. | Register_global_constant : {
    1. value : Script_repr.lazy_expr;
    } -> Kind.register_global_constant manager_operation
and counter = Z.t
type 'kind internal_operation = {
  1. source : Contract_repr.contract;
  2. operation : 'kind manager_operation;
  3. nonce : int;
}
type packed_manager_operation =
  1. | Manager : 'kind manager_operation -> packed_manager_operation
type packed_contents =
  1. | Contents : 'kind contents -> packed_contents
type packed_contents_list =
  1. | Contents_list : 'kind contents_list -> packed_contents_list
val of_list : packed_contents list -> (packed_contents_list, Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.error Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.trace) result
type packed_protocol_data =
  1. | Operation_data : 'kind protocol_data -> packed_protocol_data
type packed_operation = {
  1. shell : Tezos_base.Operation.shell_header;
  2. protocol_data : packed_protocol_data;
}
val pack : 'kind operation -> packed_operation
type packed_internal_operation =
  1. | Internal_operation : 'kind internal_operation -> packed_internal_operation
val manager_kind : 'kind manager_operation -> 'kind Kind.manager
val contents_encoding : packed_contents Data_encoding.t
val contents_list_encoding : packed_contents_list Data_encoding.t
val protocol_data_encoding : packed_protocol_data Data_encoding.t
val raw : _ operation -> raw
val acceptable_passes : packed_operation -> int list
type Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.error +=
  1. | Missing_signature
type Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.error +=
  1. | Invalid_signature
val check_signature : Tezos_crypto.Signature.public_key -> Tezos_crypto.Chain_id.t -> _ operation -> (unit, Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.error Tezos_protocol_environment_011_PtHangz2__Environment.Error_monad.trace) result
val internal_operation_encoding : packed_internal_operation Data_encoding.t
type ('a, 'b) eq =
  1. | Eq : ('a, 'a) eq
val equal : 'a operation -> 'b operation -> ('a, 'b) eq option
val packed_internal_operation_in_memory_size : packed_internal_operation -> Cache_memory_helpers.nodes_and_size
module Encoding : sig ... end
OCaml

Innovation. Community. Security.