Event subscription doesn't respect the event topics.
kraikov opened this issue · comments
After calling a single function that emits a single event, all event subscriptions are emitting in the SDK.
For example: If I call a function newContract
that emits a single event (NewContract
) and I've subscribed for NewContract
and
Withdraw
events, both event handlers are invoked for the newContract
call.
this.contract.events
.NewContract()
.on('data', (event) => {
console.log(event);
})
.on('error', console.error);
this.contract.events
.Withdraw()
.on('data', (event) => {
console.log(event);
})
.on('error', console.error);
@kraikov Interesting. This should have worked correctly, as decoding is based on the event format specified in the abi. Let me take a look. Thanks.
Okay. Would be nice if there is a way to subscribe to all events or by given topics. I don't know how events are handled internally, but this could save network bandwidth.