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:
2022-07-22 13:17:56 +05:30
committed by GitHub
parent b577db287f
commit 1bcabd64f2
69 changed files with 825 additions and 575 deletions
+2 -17
View File
@@ -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
}
}
}
`;