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

Make own version of RuntimeVersion to avoid mismatches #395

Merged
merged 3 commits into from Jan 17, 2022

Conversation

jsdw
Copy link
Collaborator

@jsdw jsdw commented Jan 17, 2022

This came about because stateVersion went away in a recentish version of substrate/polkadot, which started breaking subxt which was quite strict in what it expected to be decoded.

Here we make the decoding more lenient, only expecting the props we need and keeping props that exist but aren't needed in a HashMap incase they are useful to others.

Copy link
Contributor

@maciejhirsz maciejhirsz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, if I were (more) pedantic I'd suggest testing if serialize works too, but at this point it would be just testing serde_json.

Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we ever serialize our flavour of RuntimeVersion right? We want to flatten when deserializing, but perhaps it would be safer to keep the other key when serializing a subxt::RuntimeVersion but not sure if that's a thing in serde.

@jsdw
Copy link
Collaborator Author

jsdw commented Jan 17, 2022

Good points; I'm not actually aware of any need to Serialize that on the subxt side so I might just remove that bound and avoid thinking about it :)

Others can easily replicate and serialize what they need anyway, and we can think about adding it back if it's genuinely useful.

@jsdw jsdw merged commit d99cb9f into master Jan 17, 2022
@jsdw jsdw deleted the jsdw-runtime-version-fix branch January 17, 2022 14:25
0623forbidden pushed a commit to DEIPworld/substrate-subxt that referenced this pull request Feb 15, 2022
* Make own version of RuntimeVersion to avoid mismatches

* cargo fmt

* remove unneeded Serialize bound on RuntimeVersion
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.

None yet

4 participants