package tezos-protocol-015-PtLimaPt
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-015-PtLimaPt.raw/Tezos_raw_protocol_015_PtLimaPt/Ticket_token_map/index.html
Module Tezos_raw_protocol_015_PtLimaPt.Ticket_token_map
Source
A module exposing a carbonated map where keys are Ticket_token.ex_token
values.
A map where keys are Ticket_token.ex_token
values.
val update :
Alpha_context.context ->
Ticket_token.ex_token ->
(Alpha_context.context ->
'a option ->
('a option * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult) ->
'a t ->
('a t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
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.
val fold :
Alpha_context.context ->
(Alpha_context.context ->
'state ->
Ticket_token.ex_token ->
'a ->
('state * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult) ->
'state ->
'a t ->
('state * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
fold 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.
val find :
Alpha_context.context ->
Ticket_token.ex_token ->
'a t ->
('a option * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
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.
val of_list :
Alpha_context.context ->
merge_overlap:
(Alpha_context.context ->
'a ->
'a ->
('a * Alpha_context.context,
Tezos_protocol_environment_015_PtLimaPt.Error_monad.error
Tezos_protocol_environment_015_PtLimaPt.Error_monad.trace)
Tezos_protocol_environment_015_PtLimaPt.Pervasives.result) ->
(Ticket_token.ex_token * 'a) list ->
('a t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
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.
val to_list :
Alpha_context.context ->
'a t ->
((Ticket_token.ex_token * 'a) list * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
to_list m
transforms a map m
into a list. It also accounts for the gas cost for traversing the elements.
val map :
Alpha_context.context ->
(Alpha_context.context ->
Ticket_token.ex_token ->
'a ->
('b * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult) ->
'a t ->
('b t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
map 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.
val merge :
Alpha_context.context ->
merge_overlap:
(Alpha_context.context ->
'a ->
'a ->
('a * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult) ->
'a t ->
'a t ->
('a t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
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.
val to_ticket_receipt :
Alpha_context.context ->
owner:Alpha_context.Destination.t ->
Tezos_protocol_environment_015_PtLimaPt.Z.t t ->
(Alpha_context.Ticket_receipt.t * Alpha_context.context)
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
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.