[C4GT] Collective: Add tests for `PrimeAccountNotMember`
Description
Subtask under : https://github.com/cord-network/community/issues/7
New testcase can be tested under cargo test -p pallet-collective after adding it in the code.
Goals
- [ ] Add tests for
PrimeAccountNotMemberfor pallet/collective
Expected Outcome
- [ ] Test should assert for
PrimeAccountNotMemberbeing returned properly in all the possible calls. - [ ] If there are more than one function returning this error code, all of them should be validated either as one test case or as multiple test cases.
Acceptance Criteria
NA
Implementation Details
Look at other test cases, and add a test case for the same.
Ex: motions_ignoring_non_collective_proposals_works which validates error code NotMember
Mockups / Wireframes
NA
Product Name
CORD
Organization Name
Dhiway
Domain
Blockchain
Tech Skills Needed
Rust
Mentor(s)
@amarts
Complexity
[Agree]
Category
[Test]
Sub Category
[Beginner friendly]
Hey @amarts ! I would like to take up this issue. Could you please assign the same to me?
Hello @ayush572 Do you need any assistance with the issue or any progress you might want to share? Thanks.
Hi @vatsa287 , I'd like to work on this issue. Could you please assign it to me?
@vatsa287 I think the approach to this issue would be
For each function that can return PrimeAccountNotMember, we can :- Create a collective with some accounts as members. Ensure the account to be tested is not a member of the collective. For invoking the fucntion, we can Call the extrinsic or function (e.g., set_prime) with an account that is not a member. Finally, Asserting that the returned error is PrimeAccountNotMember.
Ensuring the function behaves as expected in both valid and invalid scenarios.
PrimeAccountNotMember is an error returned when a prime account is set for a collective but the account is not part of the collective.
This error ensures that only valid members of the collective can be designated as a prime account.
Is this approach correct or should i consider something else as well? Also i would like to work on this issue.
Hey @vatsa287 under the pallets section here there is no directory for pallet/collective. Has the name of the directory been changed in some of the recent PRs or do I need to create one altogether?
@vatsa287 i see there has been no activity in this issue for a while, can i get this issue assigned? Thanks
@ritankarsaha OK in the recent changes, this pallet has been removed.
Will close this issue from contribution.