package tezos-protocol-013-PtJakart
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b
doc/tezos-protocol-013-PtJakart.raw/Tezos_raw_protocol_013_PtJakart/Ticket_accounting/index.html
Module Tezos_raw_protocol_013_PtJakart.Ticket_accounting
Source
val ticket_diffs :
Alpha_context.context ->
arg_type_has_tickets:'arg Ticket_scanner.has_tickets ->
storage_type_has_tickets:'storage Ticket_scanner.has_tickets ->
arg:'arg ->
old_storage:'storage ->
new_storage:'storage ->
lazy_storage_diff:Alpha_context.Lazy_storage.diffs_item list ->
(Tezos_protocol_environment_013_PtJakart.Z.t Ticket_token_map.t
* Alpha_context.t)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.t
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.
val update_ticket_balances :
Alpha_context.context ->
self:Alpha_context.Contract.t ->
ticket_diffs:Tezos_protocol_environment_013_PtJakart.Z.t Ticket_token_map.t ->
Script_typed_ir.packed_internal_operation list ->
(Tezos_protocol_environment_013_PtJakart.Z.t * Alpha_context.t)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.t
update_ticket_balances ctxt self ~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.