package tezos-protocol-alpha

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Type-Safe Storage Access and Gas Accounting

A value of type 'a key identifies a value of type 'a in an underlying, untyped storage.

This GADT is used to enforce type-safety of the abstraction of the transactions rollup context. For this abstraction to work, it is necessary to ensure that the serialization of values 'a key and 'b key cannot collide. To that end, we use Data_encoding (see packed_key_encoding).

type packed_key =
  1. | Key : 'a key -> packed_key

A monomorphic version of Key, used for serialization purposes.

The encoding used to serialize keys to be used with an untyped storage.

val value_encoding : 'a. 'a key -> 'a Tezos_protocol_environment_alpha.Data_encoding.t

value_encoding key returns the encoding to be used to serialize and deserialize values associated to a key from and to the underlying storage.

Errors

type Tezos_protocol_environment_alpha.Error_monad.error +=
  1. | Key_cannot_be_serialized
type Tezos_protocol_environment_alpha.Error_monad.error +=
  1. | Value_cannot_be_serialized
type Tezos_protocol_environment_alpha.Error_monad.error +=
  1. | Value_cannot_be_deserialized

The Context Functor

OCaml

Innovation. Community. Security.