Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 94350d0

Browse files
Governance: Create Proposals and Sign Off workflow (#1767)
Co-authored-by: Jon Cinque <[email protected]>
1 parent ecc25f7 commit 94350d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2571
-746
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

governance/program/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ thiserror = "1.0"
2525

2626
[dev-dependencies]
2727
assert_matches = "1.5.0"
28+
proptest = "0.10"
2829
solana-program-test = "1.6.7"
2930
solana-sdk = "1.6.7"
3031

governance/program/src/error.rs

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,66 @@ pub enum GovernanceError {
3131
#[error("Governing Token Owner must sign transaction")]
3232
GoverningTokenOwnerMustSign,
3333

34-
/// Governing Token Owner or Vote Authority must sign transaction
35-
#[error("Governing Token Owner or Vote Authority must sign transaction")]
36-
GoverningTokenOwnerOrVoteAuthrotiyMustSign,
34+
/// Governing Token Owner or Delegate must sign transaction
35+
#[error("Governing Token Owner or Delegate must sign transaction")]
36+
GoverningTokenOwnerOrDelegateMustSign,
3737

3838
/// All active votes must be relinquished to withdraw governing tokens
3939
#[error("All active votes must be relinquished to withdraw governing tokens")]
4040
CannotWithdrawGoverningTokensWhenActiveVotesExist,
4141

42-
/// Invalid Voter account address
43-
#[error("Invalid Voter account address")]
44-
InvalidVoterAccountAddress,
42+
/// Invalid Token Owner Record account address
43+
#[error("Invalid Token Owner Record account address")]
44+
InvalidTokenOwnerRecordAccountAddress,
45+
46+
/// Invalid Token Owner Record Governing mint
47+
#[error("Invalid Token Owner Record Governing mint")]
48+
InvalidTokenOwnerRecordGoverningMint,
49+
50+
/// Invalid Token Owner Record Realm
51+
#[error("Invalid Token Owner Record Realm")]
52+
InvalidTokenOwnerRecordRealm,
53+
54+
/// Invalid Signatory account address
55+
#[error("Invalid Signatory account address")]
56+
InvalidSignatoryAddress,
57+
58+
/// Signatory already signed off
59+
#[error("Signatory already signed off")]
60+
SignatoryAlreadySignedOff,
61+
62+
/// Signatory must sign
63+
#[error("Signatory must sign")]
64+
SignatoryMustSign,
65+
66+
/// Invalid Proposal Owner
67+
#[error("Invalid Proposal Owner")]
68+
InvalidProposalOwnerAccount,
4569

4670
/// Invalid Governance config
4771
#[error("Invalid Governance config")]
4872
InvalidGovernanceConfig,
4973

74+
/// Proposal for the given Governance, Governing Token Mint and index already exists
75+
#[error("Proposal for the given Governance, Governing Token Mint and index already exists")]
76+
ProposalAlreadyExists,
77+
78+
/// Owner doesn't have enough governing tokens to create Proposal
79+
#[error("Owner doesn't have enough governing tokens to create Proposal")]
80+
NotEnoughTokensToCreateProposal,
81+
82+
/// Invalid State: Can't edit Signatories
83+
#[error("Invalid State: Can't edit Signatories")]
84+
InvalidStateCannotEditSignatories,
85+
86+
/// Invalid State: Can't sign off
87+
#[error("Invalid State: Can't sign off")]
88+
InvalidStateCannotSignOff,
89+
90+
/// Invalid Signatory Mint
91+
#[error("Invalid Signatory Mint")]
92+
InvalidSignatoryMint,
93+
5094
/// ---- Account Tools Errors ----
5195
5296
/// Invalid account owner

0 commit comments

Comments
 (0)