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

[C4GT] Network-Score: Add tests for SpaceMismatch #304

Open
3 tasks
vatsa287 opened this issue Feb 5, 2024 · 9 comments
Open
3 tasks

[C4GT] Network-Score: Add tests for SpaceMismatch #304

vatsa287 opened this issue Feb 5, 2024 · 9 comments
Labels

Comments

@vatsa287
Copy link
Member

vatsa287 commented Feb 5, 2024

Description

Subtask under : cord-network/community#7

New testcase can be tested under cargo test -p pallet-network-score after adding it in the code.

Goals

  • Add tests for SpaceMismatch for pallet/network-score

Expected Outcome

  • Test should assert for SpaceMismatch 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: In pallets/network-membership check method test_duplicate_member_request which validates error code MembershipAlreadyAcquired

Mockups / Wireframes

NA


Product Name

CORD

Organization Name

Dhiway

Domain

Blockchain

Tech Skills Needed

Rust

Mentor(s)

@amarts

Complexity

[Low]

Category

[Test]

Sub Category

[Beginner friendly]

@amarts amarts added the good first issue Good for newcomers label Feb 6, 2024
@Jhanvi528
Copy link
Contributor

Hey @vatsa287 sir I would love to work on this project.. Please assign this to me if possible

@VishnuAmit
Copy link

Hey @vatsa287 . If its available, I would like to contribute to this project. Kindly assign this to me. Looking forward

@PayalKumari10
Copy link

Hello @vatsa287 @amarts, I want to work on this project
Can you assign this issue to me?

@hlukare
Copy link

hlukare commented Aug 10, 2024

Hello @vatsa287 Can you please assign this issue to me under Augtoberfest24 C4GT, I want to work on this, as I have worked on testing part of 3 projects I can add testcases for this.

@VedantKhairnar
Copy link

Hello @hlukare
Do you need any help in implementing this?
Pls do let us know. Thanks.

@hlukare
Copy link

hlukare commented Aug 23, 2024 via email

@VedantKhairnar
Copy link

Hello @hlukare
Any update on the contribution?

@hlukare
Copy link

hlukare commented Sep 26, 2024

Hello @hlukare Do you need any help in implementing this? Pls do let us know. Thanks.

Hello @VedantKhairnar,

Thank you for offering assistance! Could you please provide some more details about where the SpaceMismatch error is returned within the codebase? Specifically, in which functions or parts of the pallet-network-score module should I focus on for adding the test cases?

Your guidance would be very helpful in moving forward with this issue.

Thanks!
@hlukare

@vatsa287
Copy link
Member Author

^^ @hlukare

SpaceMismatch in above context means that the rating which was registered with a space-id say 0001. But when revise_rating is called it is called with a wrong/non-existent space-id when compared to the original, at such scenario this error is thrown.

You can find it at pallets/src/network-score/lib.rs. You have to specifically test it out for revise_rating function. Write the test at tests.rs file.

See the method doc for the error details

/// Returns `Error::<T>::SpaceMismatch` if the space ID does not match
/// the original. Returns `Error::<T>::ReferenceNotAmendIdentifier` if
/// the original entry is not a debit entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants