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

Decode BTreeMap/HashMap etc as Vec<(K,V)> #456

Closed
jsdw opened this issue Feb 16, 2022 · 0 comments · Fixed by #459
Closed

Decode BTreeMap/HashMap etc as Vec<(K,V)> #456

jsdw opened this issue Feb 16, 2022 · 0 comments · Fixed by #459

Comments

@jsdw
Copy link
Collaborator

jsdw commented Feb 16, 2022

A recent change in substrate meant that we ran into #454, which was worked around in #455 by adding a hardcoded type with custom derives.

As a more permanent fix, and a simpler solution than working out what custom traits to add to certain types, @ascjones suggested instead decoding types like HashMap<K,V> and BTreeMap<K,V> into Vec<(K,V)>.

The advantage of doing this is that we don't need any particular traits to be implemented for K and V, and additionally any custom ordering and such is preserved, so that we don't need to think about custom impls on the Substrate side for such things.

Once this is implemented, remove the hack in #455.

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 a pull request may close this issue.

1 participant