mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-07-27 10:42:06 +00:00
Fix parsing event topic in graph-node watcher
This commit is contained in:
parent
31af3ed83a
commit
ef0302e23d
@ -216,9 +216,20 @@ export class GraphWatcher {
|
|||||||
const { instance, contractInterface } = this._dataSourceMap[dataSource.name];
|
const { instance, contractInterface } = this._dataSourceMap[dataSource.name];
|
||||||
assert(instance);
|
assert(instance);
|
||||||
const { exports: instanceExports } = 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).
|
// Get event handler based on event topic (from event signature).
|
||||||
const eventTopic = contractInterface.getEventTopic(eventSignature);
|
|
||||||
const eventHandler = dataSource.mapping.eventHandlers.find((eventHandler: any) => {
|
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.
|
// 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)
|
// For eg. event in subgraph.yaml: Stake(indexed address,uint256); from logDescription: Stake(address,uint256)
|
||||||
|
Loading…
Reference in New Issue
Block a user