forked from solana-labs/solana-program-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Governance: vote options (solana-labs#2544)
* feat: use VoteChoice instead of VoteWeight * chore: make clippy happy * feat: use options for ye/no vote * feat: use choices for CastVote instruction * chore: move Vote enum to tests * fix: iterate overall choices for withdrawal * chore: split ProposalOption and ProposalOptionVote * fix: calculate multi option proposal size * chore: split weighted and fractional vote choices * feat: add proposal type * feat: add reject option flag * feat: calculate final state for proposal using options results * chore: make clippy happy * fix: generalise max vote weight calculation for multiple options * feat: gate vote tipping for yes/no proposals only * chore: make clippy happy * feat: add option_index to instruction * feat: move instructions to options * chore: advance clock * chore: add await * chore: add multi option proposal tests * chore: move governing_mint to account list * feat: assert valid proposal options * feat: assert proposal is executable when instruction is added * chore: make clippy happy * chore: add tests to insert instructions into multi option proposal * chore: make clippy happy * feat: use explicit reject_option_vote_weight * feat: use Vote struct for vote results * feat: validate vote * feat: reject empty proposal options * chore: update comments * fix: allow execute only successful options * chore: add assertions for option statuses * chore: add partial success test * chore: add full success execution test * chore: add test for instructions execution for fully denied proposal * feat: finalise none executable proposals into completed state * chore: fix chat * feat: add vote_record v1 v2 roundtrip serialization * eat: add proposal_instruction v1 v2 roundtrip serialisation * chore: use VoteRecordV1 * chore: use legacy structs instead of legacy crate version * chore: rename proposal to V2 * feat: translate Proposal v1 v2 versions * chore: make clippy happy * chore: make clippy happy * chore: remove unnecessary clone for match * chore: rename get_final_vote_state to resolve_final_vote_state * fix proposal account name Co-authored-by: Jon Cinque <[email protected]> * chore: fix compilation * chore: use borsh::maybestd::io::Write * chore: consume self in serialise instructions to avoid cloning * chore: update comments * feat: add N limit placeholder to multi choice vote type * feat: increase options size to u16 * fix: use checked math Co-authored-by: Jon Cinque <[email protected]>
- Loading branch information
1 parent
cd63580
commit bf7ad18
Showing
40 changed files
with
2,874 additions
and
447 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "spl-governance" | ||
version = "2.1.3" | ||
version = "2.1.4" | ||
description = "Solana Program Library Governance Program" | ||
authors = ["Solana Maintainers <[email protected]>"] | ||
repository = "https://github.com/solana-labs/solana-program-library" | ||
|
@@ -32,7 +32,7 @@ proptest = "1.0" | |
solana-program-test = "1.8.1" | ||
solana-sdk = "1.8.1" | ||
spl-governance-test-sdk = { version = "0.1.0", path ="../test-sdk"} | ||
spl-governance-v1 = {package="spl-governance", version = "1.1.1", features = [ "no-entrypoint" ] } | ||
|
||
|
||
[lib] | ||
crate-type = ["cdylib", "lib"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.