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

[4.0 -> main] Fix incorrect serializing of std::optional when value is not provided - (GH #1189) #1374

Merged
merged 13 commits into from
Jul 5, 2023

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Jul 5, 2023

Resolves #1189 .

When serializing a std::optional field, and a value is not provided for the std::optional, we need to add into the serialization the flag specifying that a missing value is serialized. Prior to this PR, the flag was missing.

@greg7mdp greg7mdp requested review from heifner and linh2931 July 5, 2023 17:52
static fc::time_point get_deadline() {
if (max_serialization_time == fc::microseconds::maximum())
return fc::time_point(fc::microseconds::maximum());
return fc::time_point::now() + max_serialization_time;
Copy link
Member

Choose a reason for hiding this comment

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

You can use safe_add in main.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I also did a small cleanup in safe_add()

@greg7mdp greg7mdp merged commit d4ed800 into main Jul 5, 2023
@greg7mdp greg7mdp deleted the gh-1189 branch July 5, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants