cord icon indicating copy to clipboard operation
cord copied to clipboard

[C4GT] Collective: Add tests for `PrimeAccountNotMember`

Open vatsa287 opened this issue 1 year ago • 2 comments

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 PrimeAccountNotMember for pallet/collective

Expected Outcome

  • [ ] Test should assert for PrimeAccountNotMember being 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]

vatsa287 avatar Feb 05 '24 12:02 vatsa287

Hey @amarts ! I would like to take up this issue. Could you please assign the same to me?

ayush572 avatar Aug 06 '24 06:08 ayush572

Hello @ayush572 Do you need any assistance with the issue or any progress you might want to share? Thanks.

VedantKhairnar avatar Aug 26 '24 07:08 VedantKhairnar

Hi @vatsa287 , I'd like to work on this issue. Could you please assign it to me?

huamanraj avatar Dec 13 '24 14:12 huamanraj

@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.

ritankarsaha avatar Dec 27 '24 14:12 ritankarsaha

Screenshot 2025-01-02 at 3 29 24 PM

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?

ritankarsaha avatar Jan 02 '25 10:01 ritankarsaha

@vatsa287 i see there has been no activity in this issue for a while, can i get this issue assigned? Thanks

ritankarsaha avatar Jan 03 '25 06:01 ritankarsaha

@ritankarsaha OK in the recent changes, this pallet has been removed.

Will close this issue from contribution.

vatsa287 avatar Jan 03 '25 07:01 vatsa287