Skip to content
This repository has been archived by the owner on Mar 5, 2025. It is now read-only.

fix(allevents): update decode logic to handle no topics #1330

Merged
merged 2 commits into from
Feb 13, 2018

Conversation

marcusmolchany
Copy link

@marcusmolchany marcusmolchany commented Jan 27, 2018

the default for data.topics on line 53 was causing an exception on line 55:

TypeError: Cannot read property 'slice' of undefined

@coveralls
Copy link

coveralls commented Jan 27, 2018

Coverage Status

Coverage decreased (-0.1%) to 90.534% when pulling 299bb03 on marcusmolchany:marcusmolchany/allevents-decode into 3547be3 on ethereum:develop.

@marcusmolchany
Copy link
Author

not sure the best way to add tests for this one

@frozeman
Copy link
Contributor

frozeman commented Feb 1, 2018

A test case would be great. There should be some decoder tests, just add one with empty data, or create a new unit test for that. Thanks for the find though!

@marcusmolchany
Copy link
Author

@frozeman I just added a new test file. Do you know what type this._json is meant to be? An array prototype method is being used here, and that is failing my tests. I'm passing in the same json from the test data in event.decode.js.

Also wanted to note down that the same bug exists in this file, I can make another PR for that.

@frozeman frozeman merged commit bd364d7 into web3:develop Feb 13, 2018
@frozeman
Copy link
Contributor

Thanks for the fix, i'll fix the other one myself.

@frozeman
Copy link
Contributor

The this._json is the jsonInterface of the contract which will fire this event. its needed to decode the event.

@marcusmolchany marcusmolchany deleted the marcusmolchany/allevents-decode branch February 13, 2018 18:23
@marcusmolchany
Copy link
Author

thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants