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 raw events using scale_value and return the decoded Values, too #576

Merged
merged 3 commits into from
Jun 22, 2022

Conversation

jsdw
Copy link
Collaborator

@jsdw jsdw commented Jun 21, 2022

Remove the decode logic and rely on scale-value instead. Since that returns Value types which are more descriptive than just the event bytes, we forward those on in the RawEventDetails.

There will be a small hit to performance as a result of using scale_value's decode, since it doesn't just throw the bytes away but instead builds and returns Value types. I think the tradeoff of not having to have duplicate decode logic (and the scale_value decode stuff I think does the best job so far of catering for edge cases and bitvec handling and such) is worth it though.

Closes #572, #570

@jsdw jsdw added this to the Release 0.23 milestone Jun 21, 2022
Copy link
Contributor

@ascjones ascjones left a comment

Choose a reason for hiding this comment

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

Awesome!

@jsdw jsdw merged commit 1e8d095 into master Jun 22, 2022
@jsdw jsdw deleted the jsdw-scale-value-event-decoding branch June 22, 2022 09:43
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.

Migrate subxt event decoding to use scale-value
3 participants