-
Notifications
You must be signed in to change notification settings - Fork 43
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: to amino methods #558
Conversation
Hi, Thank you very much for your PR! Recently I also tried to handle empty fields of amino codecs: And here’s the tests: Based on the document, I believe for aminoJSON, we should use dont_omitempty to decide how we omit: telescope/__fixtures__/osmojs/cosmos-sdk/proto/amino/amino.proto Lines 60 to 78 in 4ee0271
And for (gogoproto.jsontag) = "omitempty", is it possible that it’s for to and fromJson? |
And could you please specify other bugs you're trying to fix with a few lines(better post another PR without omitempty issue) , then we can see if we can merge them first beside the omitempty issue. That would be so much appreciated! |
Thanks, The main issue with this is that as far as I have tested, when I generate go codes from protos, it ignores the |
Ok, I got it. I'll see what I can do asap to get these feature merged |
Hi, I created another PR for padDecimal only, and it's merged: I added more test and an option for padDecimal "aminoEncoding.customTypes.useCosmosSDKDec". You can use this option to enable the feature. And I also noticed that Dec arrays are not handled, so I refined the logic in the PR. |
Thanks, this helps alot. |
Yes, I'm on it, created another PR for it: |
Merged, thx to your contribution. Next time please make sure to commit one bug fix each PR instead of mixing them up. |
This PR focuses on fixing issues with amino encoding, mainly changing the way default values are handled with respect to
omit_empty
rules.At top of this, It also fixes the issue with decimal values by automatically padding the decimal strings to 18 decimal points.