package tezos-protocol-alpha
This module defines a data type t
that represents messages from Layer 2 to Layer 1.
They are part of the Rollup Management Protocol
that defines the communication protocol for exchanging messages between Layer 1 and Layer 2 for smart-contract rollups.
An outbox-message consists of a sequence of transactions to L1 smart-contract accounts. All transactions contained in a message are intended to be executed as a batch.
type transaction = {
unparsed_parameters : Script_repr.expr;
(*The payload.
*)destination : Contract_hash.t;
(*The recipient contract.
*)entrypoint : Entrypoint_repr.t;
(*Entrypoint of the destination.
*)
}
A transaction from L2 to L1.
type typed_transaction = {
unparsed_parameters : Script_repr.expr;
(*The payload.
*)unparsed_ty : Script_repr.expr;
(*The type of the payload.
*)destination : Contract_hash.t;
(*The recipient contract.
*)entrypoint : Entrypoint_repr.t;
(*Entrypoint of the destination.
*)
}
A transaction from L2 to L1, with typed payload.
type t =
| Atomic_transaction_batch of {
transactions : transaction list;
}
| Atomic_transaction_batch_typed of {
transactions : typed_transaction list;
}
| Whitelist_update of Sc_rollup_whitelist_repr.t option
A type representing messages from Layer 2 to Layer 1.
val encoding : t Tezos_protocol_environment_alpha.Data_encoding.t
val pp : Tezos_protocol_environment_alpha.Format.formatter -> t -> unit
val deserialize :
serialized ->
t Tezos_protocol_environment_alpha.Error_monad.tzresult
deserialize ctxt bs
decodes an outbox message value from the given data bs
. The function involves parsing Micheline expressions to typed values.
val serialize :
t ->
serialized Tezos_protocol_environment_alpha.Error_monad.tzresult
serialize msg
serializes the given outbox message msg
.
val unsafe_of_string : string -> serialized
unsafe_of_string s
builds a serialized value out of a string. You must understand the invariants of serialized
to do so.
val unsafe_to_string : serialized -> string
unsafe_to_string s
builds a string out of a serialized value. You must understand the invariants of serialized
to manipulate the resulting string.