package tezos-protocol-012-Psithaca
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Contract_delegate_storage/index.html
Module Tezos_raw_protocol_012_Psithaca.Contract_delegate_storage
Source
val find :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_012_Psithaca.Signature.Public_key_hash.t option
Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
find ctxt contract
returns the delegate associated to contract
, or None
if contract
has no delegate].
val registered :
Raw_context.t ->
Tezos_protocol_environment_012_Psithaca.Signature.Public_key_hash.t ->
bool Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
registered ctxt delegate
returns true iff delegate is an implicit contract that delegates to itself.
val init :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_012_Psithaca.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
init ctxt contract delegate
sets the delegate
associated to contract
.
This function is undefined if contract
is not allocated, or if contract
has already a delegate.
val remove :
Raw_context.t ->
Contract_repr.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
remove 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 is undefined if contract
is not allocated.
val delete :
Raw_context.t ->
Contract_repr.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
delete ctxt contract
behaves as remove ctxt contract
, but in addition removes the association of the contract
to its current delegate, leaving the former with no delegate.
This function is undefined if contract
is not allocated.
val set :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_012_Psithaca.Signature.Public_key_hash.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
set ctxt contract delegate
updates the delegate
associated to contract
.
This function is undefined if contract
is not allocated, or if contract
does not have a delegate.
val delegated_contracts :
Raw_context.t ->
Tezos_protocol_environment_012_Psithaca.Signature.Public_key_hash.t ->
Contract_repr.t list Tezos_protocol_environment_012_Psithaca.Lwt.t
delegated_contracts ctxt delegate
returns the list of contracts (implicit or originated) that delegated to delegate
.
val add_contract_stake :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
add_contract_stake ctxt contract amount
calls Stake_storage.add_stake ctxt delegate amount
if contract
has a delegate
. Otherwise this function does nothing.
val remove_contract_stake :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_012_Psithaca.Error_monad.tzresult
Tezos_protocol_environment_012_Psithaca.Lwt.t
remove_contract_stake ctxt contract amount
calls Stake_storage.remove_stake ctxt delegate amount
if contract
has a delegate
. Otherwise this function does nothing.