Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Governance: v3.1 #3915

Merged
merged 9 commits into from
Dec 15, 2022
Merged

Governance: v3.1 #3915

merged 9 commits into from
Dec 15, 2022

Conversation

SebastianBor
Copy link
Contributor

Summary

Governance v3.1 changes

* feat: Use proposal seed instead of index

* chore: Rename and reset legacy1 to reserved1

* chore: Make Clippy happy

* chore: Fix Chat tests compilation
* feat: Remove Realm.voting_proposal_count

* chore: Update comments

* chore: Add tests and explicit assertions for non existing accounts
* feat: Extend unrelinquished_votes_count to u64

* chore: Update comments and names

* chore: Update asserts

* chore: Update comments

* chore: Use u32:MAX to trim unrelinquished_votes_count

* chore: Make Clippy happy

* chore: Update versioning cleanup comments
* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* chore: Update comments

* fix: Assert new account size is greater than the existing one
* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* feat: Add extra_lamports to create_and_serialize_account

* chore: Make Clippy happy

* feat: Implement Proposal security deposit

* chore: Make Clippy happy

* chore: Add proposal deposit amount tests

* feat: Implement RefundProposalDeposit

* chore: test_refund_proposal_deposit

* chore: Make Clippy happy

* chore: test_refund_proposal_deposit_with_cannot_refund_draft_proposal_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_record_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_error

* fix: Return deposit to deposit payer

* chore: Cleanup

* chore: test_refund_proposal_deposit_with_invalid_proposal_deposit_account_error

* fix: Remove unnecessary max(1) for account lamports
* chore: Update active_proposal_count comment

* chore: Update account indices in process_create_proposal

* fix: Disallow u8::MAX for deposit_exempt_proposal_count

* chore: Use u64 without option for extra_lamports

* fix: Use explicit version 1 for TokenOwnerRecord migration

* chore: Update math for RealmConfigAccount::get_max_size

* fix: Flag ProposalCoolOffTimeNotSupported as legacy instead of reusing it
* feat: Add proposal and payer to ProposalDeposit account

* chore: Update tests

* feat: Use referential fields to check ProposalDeposit

* chore: Make Clippy happy

* chore: Update Proposal deposit amount comments

* chore: Update deposit amount comment
@SebastianBor SebastianBor marked this pull request as ready for review December 15, 2022 12:01
@SebastianBor SebastianBor merged commit c750e03 into master Dec 15, 2022
@SebastianBor SebastianBor deleted the governance_v3_1 branch December 15, 2022 12:01
HaoranYi pushed a commit to HaoranYi/solana-program-library that referenced this pull request Jul 19, 2023
* Governance: Remove proposal counter (solana-labs#127)

* feat: Use proposal seed instead of index

* chore: Rename and reset legacy1 to reserved1

* chore: Make Clippy happy

* chore: Fix Chat tests compilation

* Governance: Remove Realm voting proposal count (solana-labs#128)

* feat: Remove Realm.voting_proposal_count

* chore: Update comments

* chore: Add tests and explicit assertions for non existing accounts

* Governance: Remove TokenOwnerRecord total_votes_count (solana-labs#130)

* feat: Extend unrelinquished_votes_count to u64

* chore: Update comments and names

* chore: Update asserts

* chore: Update comments

* chore: Use u32:MAX to trim unrelinquished_votes_count

* chore: Make Clippy happy

* chore: Update versioning cleanup comments

* Governance: Active proposal count (solana-labs#131)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* chore: Update comments

* fix: Assert new account size is greater than the existing one

* Governance: Proposal deposit (solana-labs#135)

* feat: Add active_proposal_count to Governance

* feat: Reallocate GovernanceV1 to GovernanceV2

* chore: test_create_proposal_and_migrate_v1_governance_to_v2

* chore: Cleanup code

* chore: Update comments

* chore: Use assert_is_valid_realm instead of deserializing the account

* chore: Update comments

* chore: Update comments

* chore: Check for empty account first

* feat: Add extra_lamports to create_and_serialize_account

* chore: Make Clippy happy

* feat: Implement Proposal security deposit

* chore: Make Clippy happy

* chore: Add proposal deposit amount tests

* feat: Implement RefundProposalDeposit

* chore: test_refund_proposal_deposit

* chore: Make Clippy happy

* chore: test_refund_proposal_deposit_with_cannot_refund_draft_proposal_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_record_error

* chore: test_refund_proposal_deposit_with_invalid_proposal_owner_error

* fix: Return deposit to deposit payer

* chore: Cleanup

* chore: test_refund_proposal_deposit_with_invalid_proposal_deposit_account_error

* fix: Remove unnecessary max(1) for account lamports

* Governance: Review feedback (solana-labs#139)

* chore: Update active_proposal_count comment

* chore: Update account indices in process_create_proposal

* fix: Disallow u8::MAX for deposit_exempt_proposal_count

* chore: Use u64 without option for extra_lamports

* fix: Use explicit version 1 for TokenOwnerRecord migration

* chore: Update math for RealmConfigAccount::get_max_size

* fix: Flag ProposalCoolOffTimeNotSupported as legacy instead of reusing it

* Governance: Add proposal and payer to ProposalDeposit account (solana-labs#141)

* feat: Add proposal and payer to ProposalDeposit account

* chore: Update tests

* feat: Use referential fields to check ProposalDeposit

* chore: Make Clippy happy

* chore: Update Proposal deposit amount comments

* chore: Update deposit amount comment

* chore: Update versions (solana-labs#142)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant