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

Fixes: #304 : Add Test Cases for SpaceMismatch Error in pallet-network-score #534

Merged
merged 6 commits into from
Jan 12, 2025

Conversation

huamanraj
Copy link
Contributor

This PR introduces new test cases for handling the SpaceMismatch error within the pallet-network-score module. It addresses the requirement specified in #304 to validate that the SpaceMismatch error is correctly returned across all applicable function calls.

Key Changes:

Added a test case, test_space_mismatch_in_rating_registration, to assert the correct handling of the SpaceMismatch error when there is a mismatch between the space digest and authorization ID during the rating registration process.
The test ensures that the error is properly triggered when attempting to register ratings with incorrect space authorization.
All functions that return the SpaceMismatch error have been validated, ensuring that this error is caught in various scenarios.

Implementation Details:

Followed the structure and approach of existing test cases such as test_duplicate_member_request in pallet-network-membership.
Focused on simulating space mismatch scenarios in rating registration and confirming that the correct error is returned.

Expected Outcome:

The test should assert that the SpaceMismatch error is returned properly in all relevant calls.
The validation covers all functions returning this error, either through a single comprehensive test case or multiple focused test cases.

@huamanraj
Copy link
Contributor Author

Hey @vatsa287,
could you please review this PR when you get a chance?

pallets/network-score/src/tests.rs Outdated Show resolved Hide resolved
@vatsa287
Copy link
Member

@huamanraj No changes are required at lib.rs level. Make the changes at test file.

@huamanraj
Copy link
Contributor Author

huamanraj commented Dec 22, 2024

@vatsa287 please review this!!

pallets/network-score/src/tests.rs Outdated Show resolved Hide resolved
@huamanraj
Copy link
Contributor Author

@vatsa287 please review! is it good?

vatsa287
vatsa287 previously approved these changes Jan 6, 2025
Copy link
Member

@vatsa287 vatsa287 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Fix the pre PR checks by referring the README on contributing guidelines part.

@huamanraj
Copy link
Contributor Author

LGTM. Fix the pre PR checks by referring the README on contributing guidelines part.

@vatsa287 Fixed!!

@huamanraj huamanraj changed the title Fixes: #304 : Add Test Cases for SpaceMismatch Error in pallet-network-score Fixes: #304 : Add Test Cases for SpaceMismatch Error in pallet-network-score Jan 6, 2025
Copy link
Member

@vatsa287 vatsa287 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@huamanraj
Copy link
Contributor Author

huamanraj commented Jan 7, 2025

@amarts please merge this PR!

@vatsa287 vatsa287 merged commit 5909de8 into dhiway:develop Jan 12, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants