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

pallet-membership should implement ContainsLengthBound #1143

Closed
xlc opened this issue May 21, 2021 · 7 comments
Closed

pallet-membership should implement ContainsLengthBound #1143

xlc opened this issue May 21, 2021 · 7 comments
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request.

Comments

@xlc
Copy link
Contributor

xlc commented May 21, 2021

otherwise we can't use it with pallet-tips without wrapper

@stale
Copy link

stale bot commented Jul 7, 2021

Hey, is anyone still working on this? Due to the inactivity this issue has been automatically marked as stale. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the A5-stale label Jul 7, 2021
@ggwpez ggwpez transferred this issue from paritytech/substrate Aug 25, 2023
@the-right-joyce the-right-joyce added A2-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. and removed A5-stale labels Aug 25, 2023
@ggwpez ggwpez added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. I5-enhancement An additional feature request. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. and removed A2-stale Pull request did not receive any updates in a long time. No review needed at this stage. Close it. labels Mar 13, 2024
@Aideepakchaudhary
Copy link
Contributor

Hi @xlc, Is anyone working on this issue?

@xlc
Copy link
Contributor Author

xlc commented Jun 19, 2024

I guess not

@Aideepakchaudhary
Copy link
Contributor

Can you please elaborate this issue statement?

@xlc
Copy link
Contributor Author

xlc commented Jun 20, 2024

implement trait ContainsLengthBound for pallet membership

pub trait ContainsLengthBound {

example

impl<T: Config> ContainsLengthBound for Pallet<T> {
fn min_len() -> usize {
0
}
/// Implementation uses a parameter type so calling is cost-free.
fn max_len() -> usize {
T::DesiredMembers::get() as usize
}
}

@Aideepakchaudhary
Copy link
Contributor

Aideepakchaudhary commented Jun 22, 2024

@xlc I have raised a PR for this issue. Please let me know if something need to be update further. Thank you

github-merge-queue bot pushed a commit that referenced this issue Jun 24, 2024
### ISSUE
Link to the issue:
#1143

Deliverables
 - Implement trait `ContainsLengthBound` for pallet-membership
 

### Test Outcomes
___
Successful tests by running `cargo test -p pallet-membership --features
runtime-benchmarks`



running 22 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests
... ok
test benchmark::bench_clear_prime ... ok
test tests::add_member_works ... ok
test tests::change_key_with_same_caller_as_argument_changes_nothing ...
ok
test tests::change_key_works ... ok
test benchmark::bench_set_prime ... ok
test benchmark::bench_remove_member ... ok
test benchmark::bench_change_key ... ok
test tests::change_key_works_that_does_not_change_order ... ok
test benchmark::bench_reset_members ... ok
test benchmark::bench_add_member ... ok
test tests::genesis_build_panics_with_duplicate_members - should panic
... ok
test benchmark::bench_swap_member ... ok
test tests::query_membership_works ... ok
test tests::prime_member_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::remove_member_works ... ok
test tests::migration_v4 ... ok
test tests::swap_member_with_identical_arguments_changes_nothing ... ok
test tests::swap_member_works_that_does_not_change_order ... ok
test tests::swap_member_works ... ok
test tests::reset_members_works ... ok

test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
out; finished in 0.01s

   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

---------

Co-authored-by: Bastian Köcher <[email protected]>
@Aideepakchaudhary
Copy link
Contributor

Aideepakchaudhary commented Jun 24, 2024

@xlc I think we close this issue

@bkchr bkchr closed this as completed Jun 24, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Runtime / FRAME Jun 24, 2024
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this issue Aug 2, 2024
### ISSUE
Link to the issue:
paritytech#1143

Deliverables
 - Implement trait `ContainsLengthBound` for pallet-membership
 

### Test Outcomes
___
Successful tests by running `cargo test -p pallet-membership --features
runtime-benchmarks`



running 22 tests
test tests::__construct_runtime_integrity_test::runtime_integrity_tests
... ok
test benchmark::bench_clear_prime ... ok
test tests::add_member_works ... ok
test tests::change_key_with_same_caller_as_argument_changes_nothing ...
ok
test tests::change_key_works ... ok
test benchmark::bench_set_prime ... ok
test benchmark::bench_remove_member ... ok
test benchmark::bench_change_key ... ok
test tests::change_key_works_that_does_not_change_order ... ok
test benchmark::bench_reset_members ... ok
test benchmark::bench_add_member ... ok
test tests::genesis_build_panics_with_duplicate_members - should panic
... ok
test benchmark::bench_swap_member ... ok
test tests::query_membership_works ... ok
test tests::prime_member_works ... ok
test tests::test_genesis_config_builds ... ok
test tests::remove_member_works ... ok
test tests::migration_v4 ... ok
test tests::swap_member_with_identical_arguments_changes_nothing ... ok
test tests::swap_member_works_that_does_not_change_order ... ok
test tests::swap_member_works ... ok
test tests::reset_members_works ... ok

test result: ok. 22 passed; 0 failed; 0 ignored; 0 measured; 0 filtered
out; finished in 0.01s

   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

---------

Co-authored-by: Bastian Köcher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. D0-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder. I5-enhancement An additional feature request.
Projects
Status: Done
Development

No branches or pull requests

5 participants