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

if multiple events, return array #1048

Merged
merged 8 commits into from
Oct 4, 2017
Merged

if multiple events, return array #1048

merged 8 commits into from
Oct 4, 2017

Conversation

ewingrj
Copy link
Contributor

@ewingrj ewingrj commented Sep 16, 2017

This fixes a bug where if a transaction emitted multiple of the same
events, the transactionReceipt only returned 1 of them.

We now return an object for the event if there is only 1. If there are
multple of the same events, then we return an array of event objects

This fixes a bug where if a transaction emitted multiple of the same
events, the transactionReceipt only returned 1 of them.

We now return an object for the event if there is only 1. If there are
multple of the same events, then we return an array of event objects
@frozeman
Copy link
Contributor

It would make it really hard to reason, as you sometimes you get arrays and other times you get objects. But sadly i have no better option either.
Please also update the docs: http://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#id21
In the example you can simple showcase it by adding

...
"MyMultipleEvent": [{...},{...}] // if multiply of the same event, it comes as array

For the test, please instead of altering an existing one, add a new one instead.

Thanks so much for your contribution!

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 85.192% when pulling 1d9c400 on perissology:logs into f5bc2ba on ethereum:1.0.

@coveralls
Copy link

coveralls commented Sep 19, 2017

Coverage Status

Coverage increased (+0.07%) to 85.283% when pulling 1f63954 on perissology:logs into d816f70 on ethereum:1.0.

@coveralls
Copy link

coveralls commented Sep 19, 2017

Coverage Status

Coverage decreased (-0.2%) to 85.145% when pulling 92f6ecf on perissology:logs into f3fc88a on ethereum:1.0.

@coveralls
Copy link

coveralls commented Sep 20, 2017

Coverage Status

Coverage decreased (-0.2%) to 85.145% when pulling a36bf50 on perissology:logs into f3fc88a on ethereum:1.0.

@coveralls
Copy link

coveralls commented Sep 20, 2017

Coverage Status

Coverage decreased (-0.2%) to 85.145% when pulling a36bf50 on perissology:logs into f3fc88a on ethereum:1.0.

@coveralls
Copy link

coveralls commented Sep 25, 2017

Coverage Status

Coverage decreased (-0.02%) to 85.15% when pulling 5063359 on perissology:logs into d6c656a on ethereum:1.0.

@coveralls
Copy link

coveralls commented Oct 3, 2017

Coverage Status

Coverage decreased (-0.02%) to 85.295% when pulling 34dde09 on perissology:logs into e633406 on ethereum:1.0.

@frozeman frozeman merged commit 50deb76 into web3:1.0 Oct 4, 2017
nachomazzara pushed a commit to nachomazzara/web3.js that referenced this pull request Jun 4, 2020
* return array of events if multiple

This fixes a bug where if a transaction emitted multiple of the same
events, the transactionReceipt only returned 1 of them.

We now return an object for the event if there is only 1. If there are
multple of the same events, then we return an array of event objects

* update docs and create new test

* remove spacing changes
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.

3 participants