Sebastian Bor
6dfc68db13
Governance: Council membership & plugins ( #3344 )
...
* chore: Use GovernanceTokenConfig
* wip: add council_token_config to RealmConfigAccount
* chore: update comment
* wip: use GoverningTokenConfigArgs for community token config
* chore: Change Proxy token type to Dormant
* chore: Update comments
* chore: Use GoverningTokenConfigAccountArgs for instructions creators
* chore: Use default GoverningTokenType
* chore: Make community_token_args optional
* chore: Make Clippy happy
* chore: Update comments
* chore: Always create RealmConfigAccount
* chore: Set CouncilTokenConfig when realm is created
* feat: Update RealmConfigArgs in SetRealmConfig
* chore: Make Clippy happy
* chore: Assert RealmConfigAccount PDA
* wip: Use default RealmConfigAccount if the account doesn't exist
* chore: Remove use_community_voter_weight_addin and use_max_community_voter_weight_addin from RealmConfig
* chore: code review cleanup
* wip: Use voter weight addin for Council
* feat: Use max_voter_weight_plugin for Council
* feat: Impl RevokeGoverningTokens instruction
* chore: Make Clippy happy
* feat: Enforce governing token withdraw and deposit rules
* feat: Support minting deposits
* feat: Do not enforce token source owner for deposit validation
* chore: test_deposit_community_tokens_using_mint
* chore: Remove not implemented comment
* fix: Fix progrma id for resolving realm config for chat
* chore: Update instructions comments
* feat: Do not allow community Liquid token change to Membership
* chore: test_set_realm_config_with_liquid_community_token_cannot_be_changed_to_memebership_error
* chore: test_set_realm_config_for_community_token
* chore: use GoverningTokenConfig for test args
* chore: Refactor SetRealmConfigArgs
* chore: Update RealmSetupArgs names
* chore: test_set_realm_config_for_council_token_config
* chore: Revoke council tokens tests
* chore: test_revoke_council_tokens_with_realm_authority_must_sign_error
* chore: test_revoke_council_tokens_with_invalid_realm_authority_error
* chore: test_revoke_council_tokens_with_invalid_token_holding_error
* chore: RevokeGoverningToken tests
* chore: Dormant and Membership tokens tests
* chore: Using council plugin tests
* chore: RealmConfigAccount validation tests
* chore: Update Dormant token type configs
* fix: Reset legacy fields
* chore: Use Default macro for derivable defaults
* Chore: use assert functions to validate spl-token account and mint
* chore: Update Membership tokens comments
* chore: Pass governing_token_config_args as reference
* chore: Use single statement to return InvalidRevokeAmount error
* chore: Make Clippy happy - add derived Eq
Co-authored-by: Jon Cinque
2022-08-19 19:49:41 +02:00
Sebastian Bor
3d3b32dcf6
Governance: Veto vote ( #3156 )
...
* chore: remove #[repr(C)]
* wip: resolve proposal governing token mint
* fix: remove optionality from veto vote
* feat: implement tipping for veto vote
* fix: move vote_threshold to the end of Proposal struct
* chore: remove use super
* chore: make clippy happy
* chore: add change log
* feat: add council_veto_vote_threshold
* fix: resolve vote threshold for voting token mint
* chore: revert old function name
* fix: calculate max veto in coerce_max_voter_weight
* chore: make clippy happy
* chore: make clippy happy
* feat: Implement RelinquishVote for Veto
* chore: update comments
* chore: rename with_cast_vote to with_cast_yes_no_vote
* chore: rename with_cast_multi_option_vote to with_cast_vote
* chore: create use_veto_vote test scenario
* chore: Add veto vote disabled tests
* chore: Add partial Veto vote tests
* chore: update comments
* chore: test_cast_veto_vote_with_no_council_error
* chore: test_relinquish_veto_vote
* chore: rename with_token_owner_record to with_community_token_owner_record
* chore: test_relinquish_veto_vote_with_vote_record_for_different_voting_mint_error
* chore: test_cast_veto_vote_with_invalid_voting_mint_error
* chore: fix chat build
* chore: test_cast_veto_vote_with_council_only_allowed_to_veto
* fix: Use VoteKind to distinguish between Veto and Electorate votes
* chore: make clippy happy
* Update change log
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* chore: rename voting_token_mint to vote_governing_token_mint
* chore: test_cast_yes_and_veto_votes_with_yes_as_winning_vote
* fix: throw error for Community veto
* chore: Update comments
* chore: Update names and commnents
* chore: split try_get_tipped_vote_state into Electorate and Veto cases
* chore: Update comments
* chore: remove #[allow(clippy::float_cmp)]
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-05-17 16:37:43 +01:00
Sebastian Bor
0094255292
Governance: Max voter weight addin ( #2815 )
...
* chore: change voter-weight-addin to mock
* chore: fix tests
* chore: add action, target and expiry validation tests
* chore: add full target test checks
* feat: add max community voter weight adding structures
* chore: move payer to last account position
* wip: update max_community_voter_weight_addin
* chore: simplify logic to update realm config
* wip: setup addins when realm is created
* wip: setup voter weights accounts
* chore: make clippy happy
* core: fix merge
* chore: remove old readme
* chore: add SetupMaxVoterWeightRecord to addin mock
* chore: test_create_realm_with_max_voter_weight_addin test
* chore: add SetRealmConfigArgs and refactor tests
* chore: update max voter weight tests
* chore: setup cast_vote_with_max_voter_weight_addin test
* wip: get max voter weight from plugin
* chore: update comments and make clippy happy
* wip: use max voter weight to tip proposals
* chore: rename get_max_voter_weight
* chore: load addins using different ids
* chore: add tests with all addins
* fix: coerce max vote weight when cast votes are higher
* chore: add tests with all adins being used
* chore: add test for expired max voter weight record
* chore: simplify addin mock
* wip: Create addin api crate
* chore: use native build order and dependency
* chore: fix build
* feat: add reserved space to addin records
* chore: bump versions
* fix: use [u8; 8] discriminator for addin account types
* chore: update instruction comments
* chore: use saturating_sub instead of checked_sub
Co-authored-by: Jon Cinque
2022-01-29 02:08:21 +00:00