package tezos-protocol-alpha

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

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-17.3.tar.gz
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc

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 Error (Storage_error Existing_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.