trufflesuite/ganache

`getPastEvents.('MyEvent', { topics: [ MyEventHash, [] ] })` not returning past events

davidmurdoch opened this issue · 1 comments

jonathan.schwartz in ConsenSys slack said:

Found an inconsistency with the behavior of getPastEvents when passing an empty array to the topics option. The inconsistency is between infura rinkeby / infura mainnet and ganache-cli when running this snippet of code:

contractInstace.getPastEvents('MyEvent', { topics: [ MyEventHash, [] ] })

On rinkeby / mainnet from infura, all events with the MyEventHash get returned.

However, on ganache-cli, 0 events with the MyEventHash get returned. Instead, to achieve the same result I have to do:

contractInstace.getPastEvents('MyEvent', { topics: [ MyEventHash, null ] })

(pass null instead of an empty array to the topics option).

Closing as this is likely fixed in Ganache v7; events filtering has been completely rewritten (we previously used a 3rd party package for this).