package tezos-protocol-015-PtLimaPt
This module deals with the delegates of a contract. It is responsible for maintaining the tables Storage.Contract.Delegate
and Storage.Contract.Delegated
.
val find :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_015_PtLimaPt.Signature.Public_key_hash.t option
Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
find ctxt contract
returns the delegate associated to contract
, or None
if contract
has no delegate.
val init :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_015_PtLimaPt.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
init ctxt contract delegate
sets the delegate
associated to contract
.
This function assumes that contract
does not have a delegate already.
val unlink :
Raw_context.t ->
Contract_repr.t ->
Raw_context.t Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
unlink ctxt contract
removes contract
from the list of contracts that delegated to find ctxt contract
, i.e. the output of delegated_contracts
. This function does not affect the value of the expression find ctxt contract
.
This function assumes that contract
is allocated.
val delete :
Raw_context.t ->
Contract_repr.t ->
Raw_context.t Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
delete ctxt contract
behaves as unlink ctxt contract
, but in addition removes the association of the contract
to its current delegate, leaving the former without delegate.
This function assumes that contract
is allocated.
val set :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_015_PtLimaPt.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_015_PtLimaPt.Error_monad.tzresult
Tezos_protocol_environment_015_PtLimaPt.Lwt.t
set ctxt contract delegate
updates the delegate
associated to contract
.
This function assumes that contract
is allocated and has a delegate.
val delegated_contracts :
Raw_context.t ->
Tezos_protocol_environment_015_PtLimaPt.Signature.Public_key_hash.t ->
Contract_repr.t list Tezos_protocol_environment_015_PtLimaPt.Lwt.t
delegated_contracts ctxt delegate
returns the list of contracts (implicit or originated) that delegated to delegate
.