Fix skipped handler on contract register event case#304
Conversation
| } | ||
| }) | ||
|
|
||
| Async.it("One registration event with dynamicContracts, one without", async () => { |
There was a problem hiding this comment.
It's only this case that was broken before hand. So it's not super critical.
|
To expand, this is not super critical. The indexers that it affects is when you have a "contractRegister" and a "handler" function for a given event. The contracts would have still been registered as expected. It's just that the event would never be added to the unprocessed batch so it would never get a chance to run the handler. |
5a6d1c8 to
c08e8a0
Compare
|
|
||
| let val = switch (dynamicContracts, dynamicContractRegistrations) { | ||
| | ([], dynamicContractRegistrations) => dynamicContractRegistrations | ||
| | ([], None) => None |
There was a problem hiding this comment.
To be clear, it was hitting this case when the contractRegister function produced no registrations (possibly because of duplicate registration)
AND the current dynamicContratRegistrations was Some. Then it would just pass through the current registrations without adding itself to the unprocessed batch. Which we only want on the None case.
8fc968a to
4eee8ca
Compare
Closes #303
Need to write a test that enforces this case is handled.
Happens in the context of a batch being processed when: