refactor: implemented base for new indexer event handling approach #590
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR we are setting a base for a new approach on how we handle events in the indexer, starting with
ProjectCreated
event ofalloV1
.With this new approach we will have separated contract folders that will include the abi and the event handlers.
To retrieve the handler of an specific event we will use
getEventHandler
function that receives the contract and event names as arguments.For now we are relying in this function to delegate event handling to the old approach if the function returns undefined,
this allows us to migrate event by event or contract by contract seamlessly, while in the future we will throw an error if it returns undefined.
indexer/abis/index.ts
will be moved toindexer/contracts/abis.ts
, in that way once the migration is done, when we want to include a new strategy, we will just include the folder with its abi and its handlers, and import the abi toindexer/contracts/abis.ts
.Closes BLU-119