package tezos-protocol-020-PsParisC
val originate :
?whitelist:Sc_rollup_whitelist_repr.t ->
Raw_context.t ->
kind:Sc_rollups.Kind.t ->
parameters_ty:Script_repr.lazy_expr ->
genesis_commitment:Sc_rollup_commitment_repr.t ->
(Sc_rollup_repr.Address.t
* Tezos_protocol_environment_020_PsParisC.Z.t
* Sc_rollup_commitment_repr.Hash.t
* Raw_context.t)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
originate ?whitelist context ~kind ~parameters_ty ~genesis_commitment
produces an address a
for a smart contract rollup using the origination nonce found in context
. This function also initializes the storage with a new entry indexed by a
to remember the kind
of the rollup at address a
.
Also returns the number of allocated bytes.
val raw_originate :
?whitelist:Sc_rollup_whitelist_repr.t ->
Raw_context.t ->
kind:Sc_rollups.Kind.t ->
parameters_ty:Script_repr.lazy_expr ->
genesis_commitment:Sc_rollup_commitment_repr.t ->
address:Sc_rollup_repr.Address.t ->
(Tezos_protocol_environment_020_PsParisC.Z.t
* Sc_rollup_commitment_repr.Hash.t
* Raw_context.t)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
raw_originate ?whitelist context ~kind ~parameters_ty ~genesis_commitment ~address
is exactly originate
but provides the rollup's address (address
) instead of randomly generating it.
This should not be used by apply.ml
, this is needed for bootstrap smart rollups only.
val kind :
Raw_context.t ->
Sc_rollup_repr.t ->
(Raw_context.t * Sc_rollups.Kind.t)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
kind context address
returns the kind of the given rollup address
iff address
is an existing rollup. Fails with an Sc_rollup_does_not_exist
error in case the rollup does not exist.
val list_unaccounted :
Raw_context.t ->
Sc_rollup_repr.t list
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
val genesis_info :
Raw_context.t ->
Sc_rollup_repr.t ->
(Raw_context.t * Sc_rollup_commitment_repr.genesis_info)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
genesis_info ctxt sc_rollup
returns the level at which a sc_rollup
was originated, and its genesis commitment hash.
val get_metadata :
Raw_context.t ->
Sc_rollup_repr.t ->
(Raw_context.t * Sc_rollup_metadata_repr.t)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
get_metadata ctxt rollup
retrieves the origination level of the rollup
using Sc_rollup_commitment_repr.genesis_info
and creates a Sc_rollup_metadata_repr.t
. Fails with Sc_rollup_does_not_exist {rollup}
if the genesis info is missing.
val parameters_type :
Raw_context.t ->
Sc_rollup_repr.t ->
(Script_repr.lazy_expr option * Raw_context.t)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
parameters_type ctxt rollup
returns the registered type of a rollup. Returns None
in case there is no registered type for the rollup.
val must_exist :
Raw_context.t ->
Sc_rollup_repr.t ->
Raw_context.t Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
must_exist ctxt rollup
checks whether the given rollup
exists in ctxt
. If rollup
exists, a new context is returned with gas consumed for the lookup cost. If it does not exist, an error is returned.
val set_previous_commitment_period :
Raw_context.t ->
int ->
Raw_context.t Tezos_protocol_environment_020_PsParisC.Lwt.t
set_previous_commitment_period ctxt previous_period
is expected to be called during the protocol stitching, to ensure the previous commitment period length remains available in the next protocol, in order to deal with the commitments posted during the previous protocol but not yet cemented.
val previous_protocol_constants :
Raw_context.t ->
(Raw_level_repr.t * int)
Tezos_protocol_environment_020_PsParisC.Error_monad.tzresult
Tezos_protocol_environment_020_PsParisC.Lwt.t
previous_protocol_constants ctxt
fetches from ctxt
the first level of the current protocol and the previous commitment period.
Both values are bounded in size and small, so we don’t carbonate the call.
Warning: b This function requires that the previous commitment period has been correctly set with set_previous_commitment_period
during the latest stitching.