Skip to content

Commit

Permalink
Governance: MultiChoice type Weighted (solana-labs#3721)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Sebastian.Bor <sebastian_bor@hotmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and HaoranYi committed Jul 19, 2023
1 parent 277e5cf commit 5c1e339
Show file tree
Hide file tree
Showing 4 changed files with 1,333 additions and 39 deletions.
34 changes: 31 additions & 3 deletions governance/program/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ pub enum GovernanceError {
#[error("Proposal is not not executable")]
ProposalIsNotExecutable, // 584

/// Invalid vote
#[error("Invalid vote")]
InvalidVote, // 585
/// Deny vote is not allowed
#[error("Deny vote is not allowed")]
DenyVoteIsNotAllowed, // 585

/// Cannot execute defeated option
#[error("Cannot execute defeated option")]
Expand Down Expand Up @@ -470,6 +470,34 @@ pub enum GovernanceError {
///Invalid state for proposal state transition to Completed
#[error("Invalid state for proposal state transition to Completed")]
InvalidStateToCompleteProposal, // 613

/// Invalid number of vote choices
#[error("Invalid number of vote choices")]
InvalidNumberOfVoteChoices, // 614

/// Ranked vote is not supported
#[error("Ranked vote is not supported")]
RankedVoteIsNotSupported, // 615

/// Choice weight must be 100%
#[error("Choice weight must be 100%")]
ChoiceWeightMustBe100Percent, // 616

/// Single choice only is allowed
#[error("Single choice only is allowed")]
SingleChoiceOnlyIsAllowed, // 617

/// At least single choice is required
#[error("At least single choice is required")]
AtLeastSingleChoiceIsRequired, // 618

/// Total vote weight must be 100%
#[error("Total vote weight must be 100%")]
TotalVoteWeightMustBe100Percent, // 619

/// Invalid multi choice proposal parameters
#[error("Invalid multi choice proposal parameters")]
InvalidMultiChoiceProposalParameters, // 620
}

impl PrintProgramError for GovernanceError {
Expand Down
Loading

0 comments on commit 5c1e339

Please sign in to comment.