-
Notifications
You must be signed in to change notification settings - Fork 96
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
Json schema for Coin and some parts of Transfer #772
Json schema for Coin and some parts of Transfer #772
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #772 +/- ##
=======================================
Coverage 71.32% 71.33%
=======================================
Files 124 124
Lines 14796 14828 +32
=======================================
+ Hits 10553 10577 +24
- Misses 4243 4251 +8
☔ View full report in Codecov by Sentry. |
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.
We do coin router kind of thing in CosmWasm. It needs some IBC things, and it requests JsonSchema on types.
Great seeing you're using ibc-rs! Thanks for featuring this :)
Also, I made serde of Amount consistently decimal(decimal string). It was from str decimal, and in coin it was decimal, but on its own if was hex string. So made on its own also decimal. For some it can be breaking change. But other way schema (and CosmWasm messages) would be bad/inconsistent.
Just got a deserialization issue when tested locally. Otherwise, we are good.
- Before, serialization roundtrip (ser > deser) on both
Coin
andAmount
was ending up with a genuine value. Now, on deserialization, it fails. I think we should add a tailoreddeserialize
forU256
instead of using this. - Also, It would be great if you include a test for it.
.changelog/unreleased/improvement/772-json-schema-for-channels-and-coin.md
Outdated
Show resolved
Hide resolved
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.
Awesome!
A quick nit and then done!
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.
🙏
* support for optional json schema * some comment about using json schema * more schema * prefixed denom schema and amount fixes * final transfer things * release note * connection is needed too * std is for schema * fixed de of u256 * tests behind flag * clean up
* support for optional json schema * some comment about using json schema * more schema * prefixed denom schema and amount fixes * final transfer things * release note * connection is needed too * std is for schema * fixed de of u256 * tests behind flag * clean up
Closes: #772
Description
We do coin router kind of thing in CosmWasm. It needs some IBC things, and it requests JsonSchema on types.
So I did it.
Also, I made serde of Amount consistently decimal(decimal string). It was from str decimal, and in coin it was decimal, but on its own if was hex string. So made on its own also decimal. For some it can be breaking change. But other way schema (and CosmWasm messages) would be bad/inconsistent.
PR author checklist:
unclog
.docs/
).Reviewer checklist:
Files changed
in the GitHub PR explorer.