package tezos-protocol-013-PtJakart
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-013-PtJakart.raw/Tezos_raw_protocol_013_PtJakart/Contract_storage/index.html
Module Tezos_raw_protocol_013_PtJakart.Contract_storageSource
Low-level handlers of raw contexts for base operations on contracts.
type Tezos_protocol_environment_013_PtJakart.Error_monad.error += | Counter_in_the_future of Contract_repr.contract * Tezos_protocol_environment_013_PtJakart.Z.t * Tezos_protocol_environment_013_PtJakart.Z.t| Non_existing_contract of Contract_repr.contract| Inconsistent_public_key of Tezos_protocol_environment_013_PtJakart.Signature.Public_key.t * Tezos_protocol_environment_013_PtJakart.Signature.Public_key.t| Failure of string
val allocated :
Raw_context.t ->
Contract_repr.t ->
bool Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tallocated ctxt contract returns true if and only if the contract is stored in Storage.Contract.Balance.
val exists :
Raw_context.t ->
Contract_repr.t ->
bool Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.texists ctxt contract returns true if and only if either the contract is originated or it is (implicit and) "allocated".
val must_exist :
Raw_context.t ->
Contract_repr.t ->
unit Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tmust_exist ctxt contract fails with the Non_existing_contract error if exists ctxt contract returns false. Even though this function is gas-free, it is always called in a context where some gas consumption is guaranteed whenever necessary. The first context is that of a transfer operation, and in that case the base cost of a manager operation (Micheclson_v1_gas.Cost_of.manager_operation) is consumed. The second context is that of an activation operation, and in that case no gas needs to be consumed since that operation is not a manager operation.
val must_be_allocated :
Raw_context.t ->
Contract_repr.t ->
unit Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tmust_be_allocated ctxt contract fails when the contract is not allocated. It fails with Non_existing_contract if the contract is originated, and it fails with Empty_implicit_contract if the contract is implicit.
val list :
Raw_context.t ->
Contract_repr.t list Tezos_protocol_environment_013_PtJakart.Lwt.tval get_balance :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tget_balance ctxt contract returns the balance of spendable tez owned by contract given raw context ctxt. This does not include the contract's frozen balances.
val get_balance_carbonated :
Raw_context.t ->
Contract_repr.t ->
(Raw_context.t * Tez_repr.t)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval get_script_code :
Raw_context.t ->
Contract_repr.t ->
(Raw_context.t * Script_repr.lazy_expr option)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval update_script_storage :
Raw_context.t ->
Contract_repr.t ->
Script_repr.expr ->
Lazy_storage_diff.diffs option ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval credit_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval spend_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval raw_originate :
Raw_context.t ->
prepaid_bootstrap_storage:bool ->
Contract_repr.t ->
script:(Script_repr.t * Lazy_storage_diff.diffs option) ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.traw_originate ctxt ~prepaid_bootstrap_storage contract ~script originates the contract parameter. The storage space allocated by this origination is considered to be free of charge or to have been already paid for by the user, if and only if prepaid_bootstrap_storage is true. In particular, the amount of space allocated by this origination will be part of the consumed space to pay for returned by the next call to Fees_storage.record_paid_storage_space ctxt contract, if and only if prepaid_bootstrap_storage is false.
val fresh_contract_from_current_nonce :
Raw_context.t ->
(Raw_context.t * Contract_repr.t)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresultval originated_from_current_nonce :
since:Raw_context.t ->
until:Raw_context.t ->
Contract_repr.t list
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval set_paid_storage_space_and_return_fees_to_pay :
Raw_context.t ->
Contract_repr.t ->
Tezos_protocol_environment_013_PtJakart.Z.t ->
(Tezos_protocol_environment_013_PtJakart.Z.t * Raw_context.t)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tval increase_balance_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tIncreases the balance of a contract. Calling this function directly may break important invariants. Consider calling credit instead.
val decrease_balance_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tDecreases the balance of a contract. Calling this function directly may break important invariants. Consider calling spend instead.
val get_balance_and_frozen_bonds :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tget_balance_and_frozen_bonds ctxt contract returns the sum of the (spendable) balance and the frozen bonds associated to contract.
type Tezos_protocol_environment_013_PtJakart.Error_monad.error += | Frozen_bonds_must_be_spent_at_once of Contract_repr.t * Bond_id_repr.t
This error is raised when spend_bond_only_call_from_token is called with an amount that is not equal to the deposit associated to the given contract and bond id.
val bond_allocated :
Raw_context.t ->
Contract_repr.t ->
Bond_id_repr.t ->
(Raw_context.t * bool)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tbond_allocated ctxt contract bond_id returns a new context because of an access to carbonated data, and true if there is a bond associated to contract and bond_id, or false otherwise.
val find_bond :
Raw_context.t ->
Contract_repr.t ->
Bond_id_repr.t ->
(Raw_context.t * Tez_repr.t option)
Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tfind_bond ctxt contract bond_id returns a new context because of an access to carbonated data, and the bond associated to (contract, bond_id) if there is one, or None otherwise.
val spend_bond_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Bond_id_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tspend_bond ctxt contract bond_id amount withdraws the given amount from the value of the bond associated to contract and bond_id.
The argument amount is required to be strictly positive.
val credit_bond_only_call_from_token :
Raw_context.t ->
Contract_repr.t ->
Bond_id_repr.t ->
Tez_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tcredit_bond ctxt contract bond_id amount adds the given amount to the bond associated to contract and bond_id. If no bond exists, one whose value is amount is created.
The argument amount is required to be strictly positive.
val has_frozen_bonds :
Raw_context.t ->
Contract_repr.t ->
bool Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.thas_frozen_bonds ctxt contract returns true if there are frozen bonds associated to contract, and returns false otherwise.
val get_frozen_bonds :
Raw_context.t ->
Contract_repr.t ->
Tez_repr.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tget_frozen_bonds ctxt contract returns the total amount of bonds associated to contract.
val fold_on_bond_ids :
Raw_context.t ->
Contract_repr.t ->
order:[ `Sorted | `Undefined ] ->
init:'a ->
f:(Bond_id_repr.t -> 'a -> 'a Tezos_protocol_environment_013_PtJakart.Lwt.t) ->
'a Tezos_protocol_environment_013_PtJakart.Lwt.tfold_on_bond_ids ctxt contract order init f folds f on all bond identifiers associated to contract.
val ensure_deallocated_if_empty :
Raw_context.t ->
Contract_repr.t ->
Raw_context.t Tezos_protocol_environment_013_PtJakart.Error_monad.tzresult
Tezos_protocol_environment_013_PtJakart.Lwt.tensure_deallocated_if_empty ctxt contract de-allocates contract if its full balance is zero, and it does not delegate.