Commit Graph

8 Commits

Author SHA1 Message Date
Sebastian Bor 11ba3fb824
Governance: Constrain active proposals (#2268)
* wip: add unresolved_proposal_count to Proposal

* chore: update create_proposal test

* chore: bump version

* feat: decrease unresolved proposal count for Cancel ix

* chore: rename unresolved to outstanding

* feat: decrease outstanding proposal count for CastVote ix

* feat: decrease outstanding proposal count for FinalizeVote ix

* feat: Prevent withdrawals with outstanding proposals

* chore: fix unit test

* chore: make clippy happy

* chore: update instructions comments

* chore: temp. exclude tests with slots wrapping
2021-08-12 03:05:03 +02:00
Sebastian Bor f6f5e9a619
Governance: Min tokens to create governance (#2203)
* feat: add min_community_tokens_to_create_governance to config

* feat: add token owner record and governing mint to CreateAccountGovernance

* feat: add token owner record and governing mint to CreateMinGovernance

* feat: add token owner record and governing mint to CreateProgramGovernance

* feat: add token owner record and governing mint to CreateTokenGovernance

* feat: remove custodian

* fix: remove mint and update comments

* chore: make clippy happy

* chore: make clippy happy
2021-08-03 09:10:45 +01:00
Sebastian Bor 28928eaec2
Governance: SetGovernanceConfig instruction (#2039)
* feat: implement set_governance_config instruction

* chore: add authority error tests

* chore: rename with_instruction methods

* chore: add invalid config tests

* chore: code cleanup

* chore: cleanup test
2021-07-10 11:19:22 +01:00
Sebastian Bor cf4b264c3d
Governance: future proofing for v2 (#2002)
* chore: upgrade instruction serialisation

* chore: add assert for base64 encoded instruction

* chore: move fields with dynamic size to account  end

* chore: Add VoteThresholdPercentageType to support quorum votes in future versions

* chore: Add VoteWeightSource to support account snapshots as voter weights in future versions

* chore: Add InstructionExecutionStatus to support failing proposal instructions in future versions

* fix: update voting_at_slot when proposal enters voting state

* fix: change min_tokens_to_create_proposal to u64 to support large mints

* chore: add InstructionExecutionFlags to support ordered and transactional instruction in future versions

* chore: add withdraw tests with relinquished and unrelinquished votes

* chore: add placeholder for proposal_cool_off_time

* chore: add padding to permanent accounts to use in future versions

* chore: add ProposalCoolOffTimeNotSupported error

* chore: start governance errors from 500

* chore: update versions

* chore: update comments

* chore: use slice for reserved account space

* chore: use VoteThresholdPercentage enum to store percentage value

* chore: use enum None value instead of Option for execution_status

* chore: use enum None instead of Option for execution_flags

* chore: make clippy happy

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-07-07 14:43:31 +01:00
Sebastian Bor 775e536842
Governance: Change timestamps and time periods to UnixTimestamp (#1984)
* feat: change signing_off_at and closed_at to UnixTimestamp

* feat: change executing_at to UnixTimestamp

* feat: change voting_at and voting_completed_at to UnixTimestamp

* feat: change draft_at to UnixTimestamp

* chore: cleanup slot/timestamp comments

* chore: fix merge conflicts
2021-06-29 23:03:09 +01:00
Sebastian Bor 3c561381fd
Governance: Create token governance (#1968)
* feat: implement CreateTokenGovernance instruction

* chore: update readme

* chore: add execute transfer instruction test

* chore: update readme

* chore: update comments

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

* chore: update readme

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-06-29 22:22:42 +01:00
Sebastian Bor 329d7e38ee
Governance: Create mint governance (#1953)
* feat: implement CreateMintGovernance instruction

* fix: ensure mint is initialised in assert_is_valid_spl_token_mint

* fix: ensure token account is initialised in assert_is_valid_spl_token_account

* chore: move account type and instruction to the end to avoid breaking changes

* chore: make clippy happy

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-06-25 21:31:14 +01:00
Sebastian Bor c9e3689a94
Governance: Instructions (#1833)
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-06-05 14:06:57 +01:00