package tezos-protocol-alpha

  1. Overview
  2. Docs
Tezos/Protocol: economic-protocol definition

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-16.1.tar.gz
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f

doc/tezos-protocol-alpha.raw/Tezos_raw_protocol_alpha/Vote_storage/index.html

Module Tezos_raw_protocol_alpha.Vote_storageSource

Manages all the voting related storage in Storage.Vote.

get_delegate_proposal_count ctxt proposer returns the number of proposals already made by proposer in the current voting cycle.

This number of proposals, aka count, has its own storage bucket.

  • returns

    0 if the count of the proposer was not initialized.

  • returns

    Error Storage_error if the deserialization of count fails.

set_delegate_proposal_count ctxt proposer count sets proposer's number of submitted proposals to count.

More precisely, the relevant storage bucket is allocated and initialized to count if it didn't exist; otherwise it is simply updated.

has_proposed ctxt proposer proposal indicates whether the proposer has already proposed the proposal.

Sourcetype ballots = {
  1. yay : int64;
  2. nay : int64;
  3. pass : int64;
}

Counts of the votes

Sourceval ballots_zero : ballots

All vote counts set to zero.

Sourceval equal_ballots : ballots -> ballots -> bool

Equality check for ballots.

Pretty printer for ballots.

Records a vote for a delegate, returns a Storage_errorExisting_key if the vote was already registered

Computes the sum of the current ballots weighted by stake.

Populates !Storage.Vote.Listings using the currently existing staking power and sets `Voting_power_in_listings`. Inactive delegates or delegates without the minimal required stake are not included in the listings.

Verifies the presence of a delegate in the listing.

Sourcetype delegate_info = {
  1. voting_power : Tezos_protocol_environment_alpha.Int64.t option;
  2. current_ballot : Vote_repr.ballot option;
  3. current_proposals : Tezos_protocol_environment_alpha.Protocol_hash.t list;
  4. remaining_proposals : int;
}

Returns the sum of all voting power in the listings, without accounting for gas cost.

Returns the sum of all voting power in the listings.

Sourceval current_proposal_exists : Raw_context.t -> bool Tezos_protocol_environment_alpha.Lwt.t

Indicates whether there is a current proposal in the storage.

Retrieves the current proposal.

  • returns

    Error Storage_error if there is no current proposal, or if the deserialization fails.

Retrieves the current proposal.

  • returns

    None if there is no current proposal.

  • returns

    Error Storage_error if the deserialization fails.

Registers a current proposal.

  • returns

    Error (Storage_error Existing_key) if there was already a current proposal.

Removes the current proposal. Does nothing if there was no current proposal.

OCaml

Innovation. Community. Security.