Module-level declarations

This is a generic proposal and voting module using pubkeys as voter set members. However provider keys can be used for actual voting.

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Defined what keys to permit voting by voter set members.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

To track the transaction of each vote

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
function apply_common_voting_result(common_proposal: common_proposal)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
function delete_common_proposal(common_proposal: common_proposal)
Link copied to clipboard
Link copied to clipboard
function internal_common_vote(pubkey: byte_array, proposal: common_proposal, vote: boolean)
Link copied to clipboard
function max_common_votes(common_voter_set: common_voter_set): integer
Link copied to clipboard
function negative_common_votes(common_proposal: common_proposal): integer
Link copied to clipboard
function positive_common_votes(common_proposal: common_proposal): integer
Link copied to clipboard
@extendable function proposal_str(prop: common_proposal): text?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
function require_is_signer(pubkey: byte_array)
Link copied to clipboard
Link copied to clipboard

Queries

Link copied to clipboard

Returns common proposal info.

Link copied to clipboard

Returns common proposal voting info.

Link copied to clipboard

Returns common proposal voting results.

Link copied to clipboard
query get_common_proposals_range(from: integer, until: integer, only_pending: boolean): list<(rowid: rowid, proposal_type: common_proposal_type, state: common_proposal_state)>

Returns common proposal rowid, proposal_type and state.

Link copied to clipboard
query get_common_pubkey_votes(from: integer, until: integer, pubkey: byte_array): list<(proposal: common_proposal, vote: boolean)>

Returns common proposal and votes by criteria.

Link copied to clipboard
query get_common_voter_sets(): list<(name: text, member_key_type: common_proposal_vote_type, threshold: integer)>
Link copied to clipboard
query get_proposals_by_proposer(proposer: byte_array): list<(id: rowid, timestamp: integer, type: common_proposal_type, description: text, state: common_proposal_state)>

Returns all proposals for a specific proposer

Link copied to clipboard
query get_relevant_common_proposals(from: integer, until: integer, only_pending: boolean, my_pubkey: byte_array): list<(rowid: rowid, proposal_type: common_proposal_type, state: common_proposal_state)>

Returns relevant common proposal rowid, proposal_type and state for voter pubkey.

Operations

Link copied to clipboard
operation make_common_vote(my_pubkey: byte_array, proposal_id: rowid, vote: boolean)

Make common vote.

Permission: common voter set member

Rate limit: no

Link copied to clipboard
operation retract_common_vote(my_pubkey: byte_array, proposal_id: rowid)

Delete vote for proposal.

Permission: common voter set member

Rate limit: no

Link copied to clipboard
operation revoke_common_proposal(my_pubkey: byte_array, proposal_id: rowid)

Revoke common proposal.

Permission: proposal owner

Rate limit: no