-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: avoid rounding in serializations #415
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
=======================================
Coverage 82.89% 82.89%
=======================================
Files 37 37
Lines 1719 1719
Branches 1719 1719
=======================================
Hits 1425 1425
Misses 217 217
Partials 77 77 ☔ View full report in Codecov by Sentry. |
0ad54d5
to
8b2b64f
Compare
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.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @yair-starkware)
crates/tests-integration/tests/end_to_end_test.rs
line 35 at r1 (raw file):
let deserialized = serde_json::to_string(&serialized).unwrap(); assert_eq!(input, deserialized); }
why duplicate the test?
consider adding a function to test utils with this logic.
Code quote:
fn serialization_precision() {
let input =
"{\"value\":244116128358498188146337218061232635775543270890529169229936851982759783745}";
let serialized = serde_json::from_str::<serde_json::Value>(input).unwrap();
let deserialized = serde_json::to_string(&serialized).unwrap();
assert_eq!(input, deserialized);
}
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dafnamatsry)
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.
Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yair-starkware)
crates/gateway/Cargo.toml
line 26 at r1 (raw file):
reqwest.workspace = true serde.workspace = true serde_json = { workspace = true, features = ["arbitrary_precision"] }
Can it added in the workspace level?
Code quote:
features = ["arbitrary_precision"] }
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dafnamatsry)
crates/gateway/Cargo.toml
line 26 at r1 (raw file):
Previously, dafnamatsry wrote…
Can it added in the workspace level?
Unfortunately no, it is an open issue: rust-lang/cargo#4463
crates/tests-integration/tests/end_to_end_test.rs
line 35 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
why duplicate the test?
consider adding a function to test utils with this logic.
We need this test in each crate that uses serde_json
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yair-starkware)
crates/gateway/Cargo.toml
line 26 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
Unfortunately no, it is an open issue: rust-lang/cargo#4463
Not sure I totally understand the issue.
According to the documentation (https://doc.rust-lang.org/cargo/reference/features.html#feature-unification and https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table) feature selection is additive.
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yair-starkware)
crates/tests-integration/tests/end_to_end_test.rs
line 35 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
We need this test in each crate that uses serde_json
yes I undestood that eventually by myself, thought I retracted this comment
8b2b64f
to
7299be1
Compare
7299be1
to
97f51d1
Compare
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.
Reviewable status: 0 of 13 files reviewed, 1 unresolved discussion (waiting on @dafnamatsry and @Yael-Starkware)
crates/gateway/Cargo.toml
line 26 at r1 (raw file):
Previously, dafnamatsry wrote…
Not sure I totally understand the issue.
According to the documentation (https://doc.rust-lang.org/cargo/reference/features.html#feature-unification and https://doc.rust-lang.org/cargo/reference/workspaces.html#the-dependencies-table) feature selection is additive.
Oh I think it's new.
We had a problem with this in Papyrus.
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.
Reviewed 13 of 13 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
This change is