package tezos-protocol-012-Psithaca

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.1.tar.gz
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f

doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Ticket_storage/index.html

Module Tezos_raw_protocol_012_Psithaca.Ticket_storageSource

Sourcetype key_hash

A value of type key_hash is a hashed combination of:

  • Ticketer
  • Content type
  • Content
  • Owner
Sourceval script_expr_hash_of_key_hash : key_hash -> Script_expr_hash.t

script_expr_hash_of_key_hash key_hash returns a Script_expr_hash.t value representation of the given key_hash. This is useful for comparing and pretty-printing key-hash values.

make_key_hash ctxt ~ticketer ~typ ~contents ~owner creates a hashed representation of the given ticketer, typ, contents and owner.

get_balance ctxt key receives the ticket balance for the given key in the context ctxt. The key represents a ticket content and a ticket creator pair. In case there exists no value for the given key, None is returned.

adjust_balance ctxt key ~delta adjusts the balance of the given key (representing a ticket content, creator and owner pair) and delta. The value of delta can be positive as well as negative. If there is no pre-exising balance for the given ticket type and owner, it is assumed to be 0 and the new balance is delta. The function also returns the difference between the old and the new size of the storage. Note that the difference may be negative. For example, because when setting the balance to zero, an entry is removed.

The function fails with a Negative_ticket_balance error in case the resulting balance is negative.

OCaml

Innovation. Community. Security.