package tezos-protocol-alpha

  1. Overview
  2. Docs
Tezos protocol alpha package

Install

Dune Dependency

Authors

Maintainers

Sources

octez-19.1.tar.gz
sha256=55ea1fb8bb3273a7fc270ca8f650d45c56449665619482aad9bc12f3ea736b7e
sha512=fec850fc2d17d7490bbabd5147d62aad13b3aaed8774270f8a38ab419670ed03e0fd30cf8642a97984eca5c2446726fe590ad99c015f7ec50919dc7652f25053

doc/tezos_raw_protocol_alpha/Tezos_raw_protocol_alpha/Ticket_scanner/index.html

Module Tezos_raw_protocol_alpha.Ticket_scannerSource

This module provides an API for extracting tickets of arbitrary types from an OCaml values, given a type-witness.

Sourcetype ex_ticket =
  1. | Ex_ticket : 'a Script_typed_ir.comparable_ty * 'a Script_typed_ir.ticket -> ex_ticket

A type for representing existentially quantified tickets (tickets with different types of payloads). An ex_ticket value consists of:

  • A type-witness representing the type of the content of the ticket.
  • A ticket value of the particular content type.
Sourcetype 'a has_tickets

A type-witness that contains information about which branches of a type 'a include tickets. This value is used for traversing only the relevant branches of values when scanning for tickets.

type_has_tickets ctxt ty returns a has_tickets witness of the given shape ty.

tickets_of_value ctxt ~include_lazy ht value extracts all tickets from the given value, using the type-witness ht. The include_lazy flag determines whether or not to traverse lazy structures (values from the context). In case the include_lazy flag is true, any big-map contained in the value must have an empty overlay or else an error of type Unsupported_non_empty_overlay is returned. The reason for this restriction is that we assume that all lazy big-map diffs should be applied before calling this function. Dealing with non-empty overlays would be possible in theory, but practically difficult. The challenge is to distinguish between overlapping keys between the context and the overlay.

tickets_of_node ctxt ~include_lazy ht node extracts all tickets from the given node, using the type-witness ht.If ht indicates that values of the corresponding type may not contain tickets, the node value is not parsed. The include_lazy flag determines whether or not to traverse lazy structures (values from the context). In case the include_lazy flag is true, any big-map contained in the value must have an empty overlay or else an error of type Unsupported_non_empty_overlay is returned. The reason for this restriction is that we assume that all lazy big-map diffs should be applied before calling this function. Dealing with non-empty overlays would be possible in theory, but practically difficult. The challenge is to distinguish between overlapping keys between the context and the overlay.

Sourceval has_tickets : 'a has_tickets -> bool

has_tickets ht returns whether or not the type of the given has_tickets witness ht has tickets.

ex_ticket_size ctxt ex_ticket returns the size of the in-memory representation of ex_ticket in bytes.

Sourceval ex_token_and_amount_of_ex_ticket : ex_ticket -> Ticket_token.ex_token * Script_typed_ir.ticket_amount

ex_token_and_amount_of_ex_ticket ex_ticket returns the token and amount of the given ticket ex_ticket.

OCaml

Innovation. Community. Security.