mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-11 18:24:05 +00:00
Update codegen with changes implemented in mobymask watcher (#148)
* Update codegen with index-block CLI and remove graph-node * Add filter logs by contract flag * Skip generating GQL API for immutable variables * Add config for maxEventsBlockRange * Add new flags in existing watchers
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
//
|
||||
|
||||
import assert from 'assert';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { Cache } from '@vulcanize/cache';
|
||||
|
||||
@@ -116,24 +115,10 @@ export class EthClient {
|
||||
async getLogs (vars: Vars): Promise<any> {
|
||||
const result = await this._getCachedOrFetch('getLogs', vars);
|
||||
const {
|
||||
getLogs: resultLogs,
|
||||
block: {
|
||||
number: blockNumHex,
|
||||
timestamp: timestampHex,
|
||||
parent
|
||||
}
|
||||
getLogs
|
||||
} = result;
|
||||
|
||||
const block = {
|
||||
hash: vars.blockHash,
|
||||
number: parseInt(blockNumHex, 16),
|
||||
timestamp: parseInt(timestampHex, 16),
|
||||
parent
|
||||
};
|
||||
|
||||
const logs = resultLogs.map((logEntry: any) => _.merge({}, logEntry, { transaction: { block } }));
|
||||
|
||||
return { logs, block };
|
||||
return { logs: getLogs };
|
||||
}
|
||||
|
||||
async _getCachedOrFetch (queryName: keyof typeof ethQueries, vars: Vars): Promise<any> {
|
||||
|
||||
@@ -31,13 +31,6 @@ query getLogs($blockHash: Bytes32!, $contract: Address) {
|
||||
receiptCID
|
||||
status
|
||||
}
|
||||
block(hash: $blockHash) {
|
||||
number
|
||||
timestamp
|
||||
parent {
|
||||
hash
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user