-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rate-user: first draft modification to test - user rate is saved to mostro and sent as event too * rate user improve: users now are saved correctly based on their identity key - need to improve check on message arrival for latest trade index * some rabbit things... * Update src/db.rs Add comprehensive validation for rating parameters. Consider adding validation for all rating parameters to ensure data consistency: Validate min_rating and max_rating range Ensure min_rating <= last_rating <= max_rating Validate total_rating against total_reviews Add public_key format validation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update src/app/rate_user.rs total_reviews before calculation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update src/db.rs Add consistent validation and improve error messages. For consistency with other functions and better error handling: Add public key validation (same as in add_new_user and update_user_rating) Add trade index validation Improve error message to include the public key Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fix: calculation of user rating and last rating save on db * Fix: improved checks in rate order * Fix: math corrected with all rabbit suggestion * Fix: wrong check on incoming messages, need to check signature against rumor pubkey - changed to float total rating in user table * Fix total_rating calculation * Fix: last trade index check working * Comment on test_get_nostr_client_failure test - fails on gh actions locally working weird * Fix test: modified not passing test * Bug fixes found on this PR review * Fix: first review special case - fix on user rate update for sqlx issue documented * Fix: rate user now updates correctly max and min rate of a user in db * Shows trade public key on rate event --------- Co-authored-by: Francisco Calderón <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4f48e41
commit 51caba5
Showing
11 changed files
with
251 additions
and
63 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.