package tezos-protocol-002-PsYLVpVv

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

Variant of Single_data_storage with gas accounting.

type t
type context = t
type value

The type of the value

Tells if the data is already defined. Consumes Gas_repr.read_bytes_cost Z.zero.

Retrieve the value from the storage bucket ; returns a Storage_error if the key is not set or if the deserialisation fails. Consumes Gas_repr.read_bytes_cost <size of the value>.

Retrieves the value from the storage bucket ; returns None if the data is not initialized, or Storage_helpers.Storage_error if the deserialisation fails. Consumes Gas_repr.read_bytes_cost <size of the value> if present or Gas_repr.read_bytes_cost Z.zero.

Allocates the storage bucket and initializes it ; returns a Storage_errorMissing_key if the bucket exists. Consumes Gas_repr.write_bytes_cost <size of the value>. Returns the size.

Updates the content of the bucket ; returns a Storage_Error Existing_key if the value does not exists. Consumes Gas_repr.write_bytes_cost <size of the new value>. Returns the difference from the old to the new size.

Allocates the data and initializes it with a value ; just updates it if the bucket exists. Consumes Gas_repr.write_bytes_cost <size of the new value>. Returns the difference from the old (maybe 0) to the new size.

When the value is Some v, allocates the data and initializes it with v ; just updates it if the bucket exists. When the valus is None, delete the storage bucket when the value ; does nothing if the bucket does not exists. Consumes the same gas cost as either remove or init_set. Returns the difference from the old (maybe 0) to the new size.

Delete the storage bucket ; returns a Storage_error Missing_key if the bucket does not exists. Consumes Gas_repr.write_bytes_cost Z.zero. Returns the freed size.

Removes the storage bucket and its contents ; does nothing if the bucket does not exists. Consumes Gas_repr.write_bytes_cost Z.zero. Returns the freed size.

OCaml

Innovation. Community. Security.