Skip to content

Commit

Permalink
Fix parsing event topic in graph-node watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
nikugogoi committed Jun 25, 2024
1 parent 31af3ed commit ef0302e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/graph-node/src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,20 @@ export class GraphWatcher {
const { instance, contractInterface } = this._dataSourceMap[dataSource.name];
assert(instance);
const { exports: instanceExports } = instance;
let eventTopic: string;

try {
eventTopic = contractInterface.getEventTopic(eventSignature);
} catch (err) {
// Continue loop only if no matching event found
if (!((err as Error).message.includes('no matching event'))) {
throw err;
}

continue;
}

// Get event handler based on event topic (from event signature).
const eventTopic = contractInterface.getEventTopic(eventSignature);
const eventHandler = dataSource.mapping.eventHandlers.find((eventHandler: any) => {
// The event signature we get from logDescription is different than that given in the subgraph yaml file.
// For eg. event in subgraph.yaml: Stake(indexed address,uint256); from logDescription: Stake(address,uint256)
Expand Down

0 comments on commit ef0302e

Please sign in to comment.