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

[Communities] Benchmarking and Runtime Parameters #340

Conversation

pandres95
Copy link
Member

No description provided.

@pandres95 pandres95 marked this pull request as draft February 28, 2024 19:25
@pandres95 pandres95 changed the base branch from master to pallet-communities-voting February 29, 2024 17:53
@pandres95 pandres95 force-pushed the pallet-communities-voting branch from 32a1fc2 to ff01a3a Compare March 4, 2024 17:31
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch 2 times, most recently from cca96ff to 607cb61 Compare March 6, 2024 05:17
@pandres95 pandres95 marked this pull request as ready for review March 9, 2024 03:56
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from b61b0e4 to 590da33 Compare March 9, 2024 04:04
@pandres95 pandres95 force-pushed the pallet-communities-voting branch from ff01a3a to 27e8965 Compare March 9, 2024 12:15
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch 2 times, most recently from 8c8f7f7 to 41b3b7c Compare March 9, 2024 13:01
@pandres95 pandres95 force-pushed the pallet-communities-voting branch 2 times, most recently from f923d1d to 5ff9728 Compare March 12, 2024 01:18
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from 41b3b7c to 7e62aa0 Compare March 12, 2024 01:20
@pandres95 pandres95 force-pushed the pallet-communities-voting branch 3 times, most recently from 1ea36de to 8d1c47c Compare March 12, 2024 01:31
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from 7e62aa0 to c811231 Compare March 12, 2024 01:55
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from c811231 to 6862f46 Compare March 12, 2024 02:19
pandres95 and others added 8 commits March 11, 2024 21:33
- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking
…er, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from 6862f46 to 6a0b875 Compare March 12, 2024 02:33
@pandres95 pandres95 self-assigned this Mar 12, 2024
@pandres95 pandres95 added the enhancement New feature or request label Mar 12, 2024
Copy link
Member

@olanod olanod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, it looks good overall :)

pallets/communities/src/lib.rs Show resolved Hide resolved
pallets/communities/src/tests/mod.rs Outdated Show resolved Hide resolved
runtime/kreivo/src/communities/governance.rs Outdated Show resolved Hide resolved
runtime/kreivo/src/communities/governance.rs Show resolved Hide resolved
runtime/kreivo/src/communities/memberships.rs Show resolved Hide resolved
runtime/kreivo/src/lib.rs Show resolved Hide resolved
zombienet/kreivo-kusama-local.toml Outdated Show resolved Hide resolved
…in for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.
@pandres95 pandres95 force-pushed the pallet-communities-benchmarking-runtime-parameters branch from 2ff10f2 to a75705e Compare March 14, 2024 21:22
@pandres95 pandres95 requested a review from olanod March 15, 2024 05:01
@olanod olanod merged commit aaf12bd into pallet-communities-voting Mar 15, 2024
2 checks passed
@olanod olanod deleted the pallet-communities-benchmarking-runtime-parameters branch March 15, 2024 16:25
pandres95 added a commit that referenced this pull request Mar 17, 2024
* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* change(pallet-communities): prepare

- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking

* change(kreivo-runtime): setup benchmark helper for community tracks pallet

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmark method for unlock

* feat(kreivo-runtime): configure benchmark helper for pallet-communities

* change(pallet-communities): ensure benchmarks run with default externalities

* chore(cargo): update dependencies

* fix(kreivo-runtime): set MembershipCollectionId to 0

* fix(pallet-commujnities): remove mock out of tests module

* fix(zombienet): add parachain inclusion to relay genesis

* feat(pallet-communities): receive community accountId as a valid origin for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.

* change(kreivo-runtime): setup communities-related origins

* change(kreivo-runtime): remove Nfts pallet from runtime

- This is because it's not being used initially

* fix(kreivo-runtime): add EnsureRootWithSuccess for SubmitOrigin on CommunityReferenda

---------

Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
pandres95 added a commit that referenced this pull request Mar 21, 2024
* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* change(pallet-communities): prepare

- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking

* change(kreivo-runtime): setup benchmark helper for community tracks pallet

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmark method for unlock

* feat(kreivo-runtime): configure benchmark helper for pallet-communities

* change(pallet-communities): ensure benchmarks run with default externalities

* chore(cargo): update dependencies

* fix(kreivo-runtime): set MembershipCollectionId to 0

* fix(pallet-commujnities): remove mock out of tests module

* fix(zombienet): add parachain inclusion to relay genesis

* feat(pallet-communities): receive community accountId as a valid origin for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.

* change(kreivo-runtime): setup communities-related origins

* change(kreivo-runtime): remove Nfts pallet from runtime

- This is because it's not being used initially

* fix(kreivo-runtime): add EnsureRootWithSuccess for SubmitOrigin on CommunityReferenda

---------

Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
pandres95 added a commit that referenced this pull request Mar 29, 2024
* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* change(pallet-communities): prepare

- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking

* change(kreivo-runtime): setup benchmark helper for community tracks pallet

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmark method for unlock

* feat(kreivo-runtime): configure benchmark helper for pallet-communities

* change(pallet-communities): ensure benchmarks run with default externalities

* chore(cargo): update dependencies

* fix(kreivo-runtime): set MembershipCollectionId to 0

* fix(pallet-commujnities): remove mock out of tests module

* fix(zombienet): add parachain inclusion to relay genesis

* feat(pallet-communities): receive community accountId as a valid origin for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.

* change(kreivo-runtime): setup communities-related origins

* change(kreivo-runtime): remove Nfts pallet from runtime

- This is because it's not being used initially

* fix(kreivo-runtime): add EnsureRootWithSuccess for SubmitOrigin on CommunityReferenda

---------

Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
pandres95 added a commit that referenced this pull request Mar 29, 2024
* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* change(pallet-communities): prepare

- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking

* change(kreivo-runtime): setup benchmark helper for community tracks pallet

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmark method for unlock

* feat(kreivo-runtime): configure benchmark helper for pallet-communities

* change(pallet-communities): ensure benchmarks run with default externalities

* chore(cargo): update dependencies

* fix(kreivo-runtime): set MembershipCollectionId to 0

* fix(pallet-commujnities): remove mock out of tests module

* fix(zombienet): add parachain inclusion to relay genesis

* feat(pallet-communities): receive community accountId as a valid origin for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.

* change(kreivo-runtime): setup communities-related origins

* change(kreivo-runtime): remove Nfts pallet from runtime

- This is because it's not being used initially

* fix(kreivo-runtime): add EnsureRootWithSuccess for SubmitOrigin on CommunityReferenda

---------

Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
olanod pushed a commit that referenced this pull request Apr 4, 2024
* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* change(pallet-communities): prepare

- configure benchmark helper for pallet-referenda-tracks
- fix: missing imports for vec-like structures on benchmarking

* change(kreivo-runtime): setup benchmark helper for community tracks pallet

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member (#343)

* change(runtime/kreivo): include pallet-communities on dependencies

* chore(cargo): update Cargo.lock

* feat(pallet-communities): implement structures and storage for governance

* feat(pallet-communities): add set_decision_method extrinsic

* feat(pallet-communities): implement vote extrinsic

* chore(pallet-communities): add initial set of tests for governance section

* fix(pallet-communities): lint

* chore(cargo): update lockfile

* fix(pallet-communities:tests): typo

* feat(pallet-communities): better handle type bounds for T::Assets and T::Polls

* chore(pallet-communities): refine usage of type aliases

* change(pallet-communities:tests): support including multiple communities

* feat(pallet-communities): implement unlock call

* feat(pallet-communities:tests): extend dynamic communities creation on TestEnvBuilder to create tracks

* chore(pallet-communities): test when casting vote on an invalid track / test tie-breaking

* fix(pallet-communities): lint

* chore(pallet-communities): coverage testing for AssetBalance and NativeBalance voting methods

* chore(pallet-communities): add tests for unlock

* feat(pallet-communities): implement remove_vote

* feat(pallet-communities): implement voting for DecisionMethod::Rank

* fix(pallet-communities): lint

* chore(kreivo-runtime): subdependencies to pallet-communities

* feat(kreivo-runtime): initial parameters for pallet-communities

* chore(env): update zombienet configuration files

* chore(cargo): update lockfile

* wip(pallet-communities): initial parmeters for benchmarks

* feat(pallet-communities): bench test for create

* fix(runtime/kreivo): set FreezeIdentifier to RuntimeHoldReason on pallet_balance

* feat(pallet-communities): benchmark for set_metadata / set_decision_method

* feat(pallet-communities): preparing benchmarking helpers for loading memberships and subsequent testings

* fix(pallet-communities): check/lint

* fix(kreivo-runtime)[wip]: prepare for building with runtime-benchmarks

* change(pallet-communities): Added event emitter for removing votes. (#341)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmarking test for vote

* fix(pallet-communities): lint

* Pallet communities benchmarking runtime parameters (#342)

* change(pallet-communities): Added event emitter for removing votes.

* fix(runtime-kreivo): increase MaxHolds / increase MaxFreezes

- Increased MaxHolds: This is because we included pallet_communities::HoldReasons::Voting to the available HoldReasons
- Increase MaxFreezes: This is since you now have funds freezed if you're voting on a community.

* feat(pallet-communities): benchmarking test for add_member.

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* change(pallet-communities): sort benchmarks by call order

* feat(pallet-communities): benchmarking test for remove_vote

* refactor(pallet-communities): externalize factory dependencies from benchmarking

* fix(pallet-communities): remove unnecessary imports on benchmarking

* refactor(pallet-communities): move BenchmarkHelper to types module

* change(kreivo-runtime): configure benchmarking helpers for community related pallets

* fix(pallet-communities): gate exporting types::BenchmarkHelper behind feature flag

* fix(kreivo-runtime): missing dependencies / missing parameters

* feat(pallet-communities): finished benchmarking tests for remove_member, promote_member, and demote_member

* fix(kreivo-runtime): lint

---------

Co-authored-by: Pablo Andrés Dorado Suárez <[email protected]>

* feat(pallet-communities): benchmark method for unlock

* feat(kreivo-runtime): configure benchmark helper for pallet-communities

* change(pallet-communities): ensure benchmarks run with default externalities

* chore(cargo): update dependencies

* fix(kreivo-runtime): set MembershipCollectionId to 0

* fix(pallet-commujnities): remove mock out of tests module

* fix(zombienet): add parachain inclusion to relay genesis

* feat(pallet-communities): receive community accountId as a valid origin for CommunityMemberMgmt

- Create and implement EnsureCommunityAccountId.
- Add a benchmarking method to it.
- Setup parameter for mock.
- Setup parameter for runtime.

* change(kreivo-runtime): setup communities-related origins

* change(kreivo-runtime): remove Nfts pallet from runtime

- This is because it's not being used initially

* fix(kreivo-runtime): add EnsureRootWithSuccess for SubmitOrigin on CommunityReferenda

---------

Co-authored-by: Juan Pablo Gutiérrez Restrepo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants