Module Tezos_raw_protocol_alpha.Ticket_token_map

A module exposing a carbonated map where keys are Ticket_token.ex_token values.

type 'a t

A map where keys are Ticket_token.ex_token values.

val empty : 'a t

empty is a map without any elements.

update ctxt k f map updates or adds the value of the key k using f. The function accounts for the gas cost for finding the element. f must account for its own gas costs.

fold_e ctxt f z m folds over the map m using the initial value z and the accumulator function f. f must account for its own gas costs.

Lwt-aware variant of fold_e.

find ctxt k m looks up the value with key k in the given map m and also accounts for the gas cost of finding the key.

of_list ctxt ~merge_overlaps m creates a map from a list of key-value pairs. In case there are overlapping keys, their values are combined using the merge_overlap function. The function accounts for gas for traversing the elements. merge_overlap should account for its own gas cost.

to_list m transforms a map m into a list. It also accounts for the gas cost for traversing the elements.

map_e ctxt f m maps over all key-value pairs in the map m using the function f. It accounts for gas costs associated with traversing the elements. f must account for its own gas cost.

merge ctxt ~merge_overlap m1 m2 merges the maps m1 and m2. In case there are overlapping keys, their values are combined using the merge_overlap function. Gas costs for traversing all elements from both maps are accounted for. merge_overlap must account for its own gas costs.

to_ticket_receipt ctxt ~owner t converts a ticket token map into a ticket receipt. It also accounts for the gas cost for traversing map and unparsing the elements.