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

fix: use index override when decoding enums in events #382

Merged
merged 2 commits into from
Jan 12, 2022

Conversation

sander2
Copy link
Contributor

@sander2 sander2 commented Jan 4, 2022

Without this fix, if an event contains an enum with explicit indices, it fails to decode

Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

LGTM!

@jsdw jsdw requested a review from a team January 5, 2022 10:15
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.

I know there are already no tests for the events decoding, but I think we need some.

Should be trivial to add a test for this after #384 is merged (which adds unit testing for the EventsDecoder).

@ascjones
Copy link
Contributor

ascjones commented Jan 7, 2022

@sander2 now #384 is merged, you should be able to easily make a test for this now.

@sander2 sander2 force-pushed the enum-variant-decoding branch 2 times, most recently from 8276999 to b43743d Compare January 12, 2022 09:17
src/events.rs Outdated Show resolved Hide resolved
Copy link
Member

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Niklas Adolfsson <[email protected]>
@jsdw jsdw merged commit d1e2985 into paritytech:master Jan 12, 2022
0623forbidden pushed a commit to DEIPworld/substrate-subxt that referenced this pull request Feb 15, 2022
* fix: use index override when decoding enums in events

* fix: ignore clippy warning in test

Co-authored-by: Niklas Adolfsson <[email protected]>

Co-authored-by: Niklas Adolfsson <[email protected]>
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.

4 participants