-
Notifications
You must be signed in to change notification settings - Fork 712
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
membership: Restructure pallet into separate files #4536
Conversation
Label required: |
you forget to commit the lib.rs file? |
92824db
to
305beed
Compare
@xlc Sorry yes. I have updated the commit now. |
305beed
to
f5ed601
Compare
Please check that everything still works when running the tests. |
Review required! Latest push from author must always be reviewed |
5f37907
to
4ddacee
Compare
Yes it works fine on my local setup. vatsa@Shreevatsas-MacBook-Pro polkadot-sdk % cargo test -p pallet-membership --features=runtime-benchmarks
Finished `test` profile [unoptimized + debuginfo] target(s) in 1.60s
Running unittests src/lib.rs (target/debug/deps/pallet_membership-f44be527ad6bc1b4)
running 22 tests
test mock::__construct_runtime_integrity_test::runtime_integrity_tests ... ok
test mock::test_genesis_config_builds ... ok
test benchmarking::bench_clear_prime ... ok
test benchmarking::bench_set_prime ... ok
test benchmarking::bench_swap_member ... ok
test tests::add_member_works ... ok
test benchmarking::bench_change_key ... ok
test benchmarking::bench_reset_members ... ok
test benchmarking::bench_remove_member ... ok
test benchmarking::bench_add_member ... ok
test tests::change_key_with_same_caller_as_argument_changes_nothing ... ok
test tests::change_key_works_that_does_not_change_order ... ok
test tests::change_key_works ... ok
test tests::query_membership_works ... ok
test tests::swap_member_with_identical_arguments_changes_nothing ... ok
test tests::prime_member_works ... ok
test tests::remove_member_works ... ok
test tests::reset_members_works ... ok
test tests::swap_member_works ... ok
test tests::swap_member_works_that_does_not_change_order ... ok
test tests::migration_v4 ... ok
test tests::genesis_build_panics_with_duplicate_members - should panic ... ok
test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.02s
Doc-tests pallet-membership
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s |
@@ -33,6 +33,15 @@ use sp_std::prelude::*; | |||
pub mod migrations; | |||
pub mod weights; | |||
|
|||
#[cfg(any(feature = "mock", test))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mock
feature exist? I dont think its needed otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes mock is the file where mock
runtime is defined, required for test.
4ddacee
to
a0dfd91
Compare
bb0f992
to
70da3a1
Compare
Signed-off-by: Shreevatsa N <[email protected]>
Signed-off-by: Shreevatsa N <[email protected]>
70da3a1
to
3ec6156
Compare
@ggwpez any other changes required? Could you please approve the workflow. |
The CI pipeline was cancelled due to failure one of the required jobs. |
f5e7eaf
- What does this PR do? This PR separates `membership` pallet into separate files for `lib`, `mock` & `tests`. - Why are these changes needed? Currently `membership` pallet consists of `lib`, `mock` & `tests` written into a single file. Refactor it into separate files which makes it inline to other pallets and improves readability. - How were these changes implemented and what do they affect? The PR will not have any affect. Signed-off-by: Shreevatsa N <[email protected]> --------- Signed-off-by: Shreevatsa N <[email protected]> Co-authored-by: Bastian Köcher <[email protected]> Co-authored-by: Bastian Köcher <[email protected]>
* master: (27 commits) Bridges improved tests and nits (#5128) Fix misleading comment about RewardHandler in epm config (#3095) Introduce a workflow updating the wishlist leaderboards (#5085) membership: Restructure pallet into separate files (#4536) Fix after ring-proof api change (#5126) Bump paritytech/review-bot from 2.4.0 to 2.5.0 (#5057) Bump docker/login-action from 3.0.0 to 3.3.0 (#5109) Bump docker/build-push-action from 5.1.0 to 6.5.0 (#5108) Bump peter-evans/create-pull-request from 5.0.0 to 6.1.0 (#5093) Tx Payment: drop ED requirements for tx payments with exchangeable asset (#4488) Remove `pallet-getter` usage from pallet-transaction-payment (#4970) pallet macro: do not generate try-runtime related code when frame-support doesn't have try-runtime. (#5099) fix(chain-spec): ChainSpecBuilder with object as default genesis (#4345) Migrate BEEFY BLS crypto to bls12-381 curve (#4931) Bump clap from 4.5.9 to 4.5.10 in the known_good_semver group (#5120) Use jobserver in wasm-builder to limit concurrency of spawned cargo processes (#4946) include events for voting (#4613) [subsystem-bench] Add mocks for own assignments triggering (#5042) Remove not-audited warning (#5114) hotfix: blockchain/backend: Skip genesis leaf to unblock syncing (#5103) ...
What does this PR do?
This PR separates
membership
pallet into separate files forlib
,mock
&tests
.Why are these changes needed?
Currently
membership
pallet consists oflib
,mock
&tests
written into a single file.Refactor it into separate files which makes it inline to other pallets and improves readability.
How were these changes implemented and what do they affect?
The PR will not have any affect.
Signed-off-by: Shreevatsa N [email protected]