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

Disable serde-arbitrary-precision feature of rust-decimal #49

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

kamirr
Copy link
Contributor

@kamirr kamirr commented Sep 5, 2023

...which enabled the arbitrary-precision feature of serde-json, which broke yagna. This is because gsb-api relies on json integers being serialized as flexbuffer numbers, while arbitrary-precision makes them serialize as serde-json-specific structures. Besides that if we ever use numbers in the REST API we would obviously serialize them in a way unusable from JS/Python.

This cannot be sensibly worked around, because cargo assumes crate features are strictly additive and one cannot depend on the same library twice with the only difference being the set of enabled features.

rust-decimal Decimals were only serialized in informational messages which do not affect the correctness of the driver, so this change does not affect any financial computations.

...which enabled the arbitrary-precision feature of serde-json, which broke
yagna. This is because gsb-api relies on json integers being serialized
as flexbuffer numbers, while arbitrary-precision makes them serialize as
serde-json-specific structures.

This cannot be sensibly worked around, because cargo assumes crate
features are strictly additive and one cannot depend on the same library
twice with the only difference being the set of enabled features.

rust-decimal Decimals were only serialized in informational messages
which do not affect the correctness of the driver, so this change does
not affect any financial computations.
@kamirr kamirr requested a review from scx1332 September 5, 2023 10:37
@kamirr kamirr linked an issue Sep 5, 2023 that may be closed by this pull request
@scx1332 scx1332 merged commit 469e15a into main Sep 7, 2023
8 checks passed
@scx1332 scx1332 deleted the kek/disable-arbitrary-prec branch September 13, 2023 17:21
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.

Enable and check tests on payments-dev
2 participants