-
Notifications
You must be signed in to change notification settings - Fork 925
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(state): JSON marshaling for sdk Address wrapper #2348
Conversation
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.
So the core issue here is that cosmos sdk addresses does not implement json serialisation and reflection does not work automatically, right?
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.
Thanks the tests!
Codecov Report
@@ Coverage Diff @@
## main #2348 +/- ##
==========================================
- Coverage 50.84% 50.82% -0.02%
==========================================
Files 154 155 +1
Lines 9746 9760 +14
==========================================
+ Hits 4955 4961 +6
- Misses 4355 4365 +10
+ Partials 436 434 -2
|
While debugging #2322 , I noticed that it is not only an RPC issue, but also a broken API one. All RPC methods that used the type
state.Address
were unusable, both via the client and via raw JSON calls. This is because the server was unable to marshal the address string value back into the interface type.To circumvent this, I have embedded the sdk.Address type in the same way that we embed the fraud proof type, to allow us to unmarshal it back into a concrete type. I have also added unit tests to fix this.
In addition, it fixes the RPC parsing - so it closes #2322 .