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

added maker rating on new order creation #291

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

arkanoider
Copy link
Collaborator

Hi @grunch ,

quick add to fix issue #284, now just inserted user rating in new order creation. Maker rating should be added with new fn:

fn create_rating_string(rating: Option<Rating>) -> String {
    if rating.is_some() {
        format!("{:?}", rating.unwrap(),)
    } else {
        "No user reputation received".to_string()
    }
}

@bilthon
Copy link
Contributor

bilthon commented Jun 6, 2024

It would be preferable that the value of the tag be a JSON formatted string. Just doing format!("{:?}", rating.unwrap(),) doesn't do that, right?

@arkanoider
Copy link
Collaborator Author

arkanoider commented Jun 6, 2024

Yes we have to make it better! I think maybe that just :
"rating" : "3"
could be enough?

Feel free to drop me here what could be your preferred way of getting that data @bilthon .

@arkanoider
Copy link
Collaborator Author

@bilthon quick improvement on the format, now you should have the json formatted Rating struct in the rating tag

fn create_rating_string(rating: Option<Rating>) -> String {
    if let Some(rating) = rating {
        if let Ok(rating_json) = rating.as_json() {
            rating_json
        } else {
            "bad format value".to_string()
        }
    } else {
        "none".to_string()
    }
}

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

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

LGTM

@grunch grunch merged commit 4c4e2a6 into MostroP2P:main Jun 10, 2024
1 check passed
@arkanoider arkanoider deleted the user-reputation branch June 10, 2024 13:49
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.

3 participants