Subnet Democracy

Rewards Blockchain Pallet

Overview

The subnet democracy pallet is responsible for the logic of voting in, voting out, and replacing subnets.

Functions

Propose

Propose to activate a new subnet.

pub fn propose(
    origin: OriginFor<T>, 
    subnet_data: PreSubnetData,
    mut subnet_nodes: Vec<SubnetNode<T::AccountId>>,
    proposal_type: PropsType
) -> DispatchResult

Cast Vote

Cast a vote towards a proposal.

pub fn cast_vote(
      origin: OriginFor<T>, 
      proposal_index: PropIndex,
      vote_amount: BalanceOf<T>,
      vote: VoteType,
) -> DispatchResult

Execute

Execute a proposal, being the activation or deactivation of a subnet.

pub fn execute(
      origin: OriginFor<T>, 
      proposal_index: PropIndex,
) -> DispatchResult

Cancel Proposal

Cancel the proposal as a proposer if voting has not yet been completed.

pub fn cancel_proposal(
      origin: OriginFor<T>, 
      proposal_index: PropIndex,
) -> DispatchResult

Unreserve

Unreserve the stake used for casting a vote.

pub fn unreserve(
      origin: OriginFor<T>, 
      proposal_index: PropIndex,
) -> DispatchResult

Last updated