package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
val find : Raw_context.t -> Contract_repr.t -> (Tezos_crypto.Signature.public_key_hash option, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result Lwt.t

find ctxt contract returns the delegate associated to contract, or None if contract has no delegate].

val registered : Raw_context.t -> Tezos_crypto.Signature.public_key_hash -> (bool, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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_crypto.Signature.public_key_hash -> (Raw_context.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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_crypto.Signature.public_key_hash -> (Raw_context.t, Tezos_protocol_environment_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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.

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_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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_alpha__Environment.Error_monad.error Tezos_protocol_environment_alpha__Environment.Error_monad.trace) result 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.