mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-07 16:34:06 +00:00
Invoke subgraph handler in watcher event processing (#34)
* Invoke subgraph handler in watcher event processing * Fix error when invoking subgraph handler * Parse events using event signature specified in subgraph yaml * Use contract abi to parse event params * Invoke event handler based on event signature * Fill event with block and transaction data * Comment missing fields in block and transaction data
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { EventData } from '../../src/utils';
|
||||
|
||||
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|
||||
export const ZERO_HASH = '0x0000000000000000000000000000000000000000000000000000000000000000';
|
||||
|
||||
export const getDummyEventData = (): EventData => {
|
||||
const block = {
|
||||
hash: ZERO_HASH,
|
||||
number: 0,
|
||||
timestamp: 0,
|
||||
parentHash: ZERO_HASH
|
||||
};
|
||||
|
||||
const tx = {
|
||||
hash: ZERO_HASH,
|
||||
index: 0,
|
||||
from: ZERO_ADDRESS,
|
||||
to: ZERO_ADDRESS
|
||||
};
|
||||
|
||||
return {
|
||||
block,
|
||||
tx,
|
||||
eventParams: [],
|
||||
eventIndex: 0
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user