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_accounting/index.html

Module Tezos_raw_protocol_alpha.Ticket_accountingSource

ticket_diffs ctxt ~arg_type_has_tickets ~storage_type_has_tickets arg old_storage new_storage lazy_storage_diff returns a map from ticket-tokens to balance-differences that represents the change in balance for a contract due to changes of tickets in the storage. The assumption is that before calling ticket_diffs, all tickets that are owned by a contract exist either in the old_storage or the arg. After execution, only tickets in new_storage are owned by the contract. Note that this function avoids traversing the lazy part of the storage.

ticket_balances_of_value ctxt ~include_lazy has_tickets value scans all tickets in the given value using the type-witness has_tickets and returns a map from ticket-tokens to the amount.

update_ticket_balances ctxt ~self_contract ~ticket_diffs operations updates the ticket balances according to the ticket_diffs map and the set of operations. The function also returns the storage size diff resulting from updating the ticket-balance table in the context.

Invariant: this function must be called after applying the lazy-storage diffs affecting any contracts in the given operations.

The function fails in case an invalid ticket-token-balance update is detected. The ticket_diffs argument represents the change of ticket-tokens for the self contract. It also specifies a "budget" for outgoing ticket-tokens.

OCaml

Innovation. Community. Security.