-
Notifications
You must be signed in to change notification settings - Fork 121
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: Network-Score: Add tests for 'InvalidRatingValue' #297 #507
Conversation
Hey @mrswastik-robot , you can go to the src folder of network-score pallet and run the command
To pass the rustfmt github action |
hey @zeel991, thanks for helping me out, I have run the |
Hello @mrswastik-robot |
invalid_message_id.clone(), | ||
authorization_id.clone() | ||
), | ||
Error::<Test>::InvalidRatingValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InvalidRatingValue
is also used in revise_rating
. Please add that tests for that also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @vatsa287 , is it revise_rating_with_entry_entity or revise_rating_with_existing_rating ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No InvalidRatingValue
is being returned from two extrinsics. One being register
which you already done. Now you have to add it for revise
as well. Look at lib.rs
file, where all this is being returned from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @vatsa287 for helping me out, I read lib.rs file and have added a test function revise_rating_with_invalid_values_should_fail
in the latest commit. Please review and let me know if further changes are required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix for #297
Added the code in test.rs file which tests for the invalid rating value.
The test case is running successfully:
Do let me know if any kind of changes or improvements are required!!