package tezos-protocol-alpha

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

Module Tezos_raw_protocol_alpha.Delegate_storageSource

This module groups everything related to delegate registration. For the invariants maintained, see the submodule Contract.

It also groups "trivial" getters/setters related to delegates.

It is responsible for maintaining the following tables:

Sourcemodule Contract : sig ... end

This module ensures the following invariants:

Has a delegate been registered in the delegate table?

Iterate on all registered delegates.

Returns a delegate's frozen deposits, both the current amount and the initial freezed amount.

A delegate's frozen balance is only composed of frozen deposits; rewards and fees are not frozen, but simply credited at the right moment.

is_forbidden_delegate ctxt delegate returns true if the given delegate is forbidden to bake or attest. This means that its current frozen deposit is equal to zero. Returns false otherwise.

forbid_delegate ctxt delegate adds delegate to the set of forbidden delegates and stores the updated set, which prevents this delegate from baking or attesting.

load_forbidden_delegates ctxt reads from the storage the saved set of forbidden delegates and sets the raw context's in-memory cached value.

reset_forbidden_delegates ctxt delegates overwrites the forbidden delegates set with an empty set in both storage and in-memory.

Sourcemodule For_RPC : sig ... end

The functions in this module are considered too costly to be used in the protocol. They are meant to be used only to answer RPC calls.