cord icon indicating copy to clipboard operation
cord copied to clipboard

[C4GT] Network-Score: Add tests for `SpaceMismatch`

Open vatsa287 opened this issue 2 years ago • 8 comments

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 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]

vatsa287 avatar Feb 05 '24 17:02 vatsa287

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

Jhanvi528 avatar Mar 21 '24 18:03 Jhanvi528

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

VishnuAmit avatar Apr 25 '24 09:04 VishnuAmit

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

PayalKumari10 avatar May 02 '24 06:05 PayalKumari10

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.

hlukare avatar Aug 10 '24 06:08 hlukare

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

VedantKhairnar avatar Aug 23 '24 06:08 VedantKhairnar

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

hlukare avatar Aug 23 '24 06:08 hlukare

Hello @hlukare Any update on the contribution?

VedantKhairnar avatar Sep 16 '24 18:09 VedantKhairnar

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 avatar Sep 26 '24 15:09 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.

vatsa287 avatar Oct 18 '24 18:10 vatsa287

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