[C4GT] Network-Score: Add tests for `SpaceMismatch`
Description
Subtask under : https://github.com/cord-network/community/issues/7
New testcase can be tested under cargo test -p pallet-network-score after adding it in the code.
Goals
- [ ] Add tests for
SpaceMismatchfor pallet/network-score
Expected Outcome
- [ ] Test should assert for
SpaceMismatchbeing 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]
Hey @vatsa287 sir I would love to work on this project.. Please assign this to me if possible
Hey @vatsa287 . If its available, I would like to contribute to this project. Kindly assign this to me. Looking forward
Hello @vatsa287 @amarts, I want to work on this project Can you assign this issue to me?
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.
Hello @hlukare Do you need any help in implementing this? Pls do let us know. Thanks.
Yes, I am working on it.
On Fri, 23 Aug 2024, 11:38 Vedant Khairnar, @.***> wrote:
Hello @hlukare https://github.com/hlukare Do you need any help in implementing this? Pls do let us know. Thanks.
— Reply to this email directly, view it on GitHub https://github.com/dhiway/cord/issues/304#issuecomment-2306358784, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4VCF4XQPL7JMLU3NYWRPATZS3GVDAVCNFSM6AAAAABC2Q4AJ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGM2TQNZYGQ . You are receiving this because you were mentioned.Message ID: @.***>
Hello @hlukare Any update on the contribution?
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
^^ @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.
Hi @vatsa287 , I'd like to work on this issue. Could you please assign it to me?