Perform eth_getLogs
query only if subgraph event handlers exist
#14
@ -651,7 +651,18 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(blockHash);
|
assert(blockHash);
|
||||||
assert(blockNumber);
|
assert(blockNumber);
|
||||||
|
|
||||||
const { events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(blockHash, blockNumber, this.eventSignaturesMap, this.parseEventNameAndArgs.bind(this));
|
let dbEvents: DeepPartial<Event>[] = [];
|
||||||
|
let transactions: EthFullTransaction[] = [];
|
||||||
|
|
||||||
|
// Fetch events and txs only if subgraph config has any event handlers
|
||||||
|
if (this._graphWatcher.eventHandlerExists) {
|
||||||
|
({ events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(
|
||||||
|
blockHash,
|
||||||
|
blockNumber,
|
||||||
|
this.eventSignaturesMap,
|
||||||
|
this.parseEventNameAndArgs.bind(this)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
const dbTx = await this._db.createTransactionRunner();
|
const dbTx = await this._db.createTransactionRunner();
|
||||||
try {
|
try {
|
||||||
|
@ -657,7 +657,18 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(blockHash);
|
assert(blockHash);
|
||||||
assert(blockNumber);
|
assert(blockNumber);
|
||||||
|
|
||||||
const { events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(blockHash, blockNumber, this.eventSignaturesMap, this.parseEventNameAndArgs.bind(this));
|
let dbEvents: DeepPartial<Event>[] = [];
|
||||||
|
let transactions: EthFullTransaction[] = [];
|
||||||
|
|
||||||
|
// Fetch events and txs only if subgraph config has any event handlers
|
||||||
|
if (this._graphWatcher.eventHandlerExists) {
|
||||||
|
({ events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(
|
||||||
|
blockHash,
|
||||||
|
blockNumber,
|
||||||
|
this.eventSignaturesMap,
|
||||||
|
this.parseEventNameAndArgs.bind(this)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
const dbTx = await this._db.createTransactionRunner();
|
const dbTx = await this._db.createTransactionRunner();
|
||||||
try {
|
try {
|
||||||
|
@ -1165,7 +1165,18 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(blockHash);
|
assert(blockHash);
|
||||||
assert(blockNumber);
|
assert(blockNumber);
|
||||||
|
|
||||||
const { events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(blockHash, blockNumber, this.eventSignaturesMap, this.parseEventNameAndArgs.bind(this));
|
let dbEvents: DeepPartial<Event>[] = [];
|
||||||
|
let transactions: EthFullTransaction[] = [];
|
||||||
|
|
||||||
|
// Fetch events and txs only if subgraph config has any event handlers
|
||||||
|
if (this._graphWatcher.eventHandlerExists) {
|
||||||
|
({ events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(
|
||||||
|
blockHash,
|
||||||
|
blockNumber,
|
||||||
|
this.eventSignaturesMap,
|
||||||
|
this.parseEventNameAndArgs.bind(this)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
const dbTx = await this._db.createTransactionRunner();
|
const dbTx = await this._db.createTransactionRunner();
|
||||||
try {
|
try {
|
||||||
|
@ -1040,7 +1040,18 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(blockHash);
|
assert(blockHash);
|
||||||
assert(blockNumber);
|
assert(blockNumber);
|
||||||
|
|
||||||
const { events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(blockHash, blockNumber, this.eventSignaturesMap, this.parseEventNameAndArgs.bind(this));
|
let dbEvents: DeepPartial<Event>[] = [];
|
||||||
|
let transactions: EthFullTransaction[] = [];
|
||||||
|
|
||||||
|
// Fetch events and txs only if subgraph config has any event handlers
|
||||||
|
if (this._graphWatcher.eventHandlerExists) {
|
||||||
|
({ events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(
|
||||||
|
blockHash,
|
||||||
|
blockNumber,
|
||||||
|
this.eventSignaturesMap,
|
||||||
|
this.parseEventNameAndArgs.bind(this)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
const dbTx = await this._db.createTransactionRunner();
|
const dbTx = await this._db.createTransactionRunner();
|
||||||
try {
|
try {
|
||||||
|
@ -1424,7 +1424,18 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(blockHash);
|
assert(blockHash);
|
||||||
assert(blockNumber);
|
assert(blockNumber);
|
||||||
|
|
||||||
const { events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(blockHash, blockNumber, this.eventSignaturesMap, this.parseEventNameAndArgs.bind(this));
|
let dbEvents: DeepPartial<Event>[] = [];
|
||||||
|
let transactions: EthFullTransaction[] = [];
|
||||||
|
|
||||||
|
// Fetch events only if subgraph config has any event handlers
|
||||||
|
if (this._graphWatcher.eventHandlerExists) {
|
||||||
|
({ events: dbEvents, transactions } = await this._baseIndexer.fetchEvents(
|
||||||
|
blockHash,
|
||||||
|
blockNumber,
|
||||||
|
this.eventSignaturesMap,
|
||||||
|
this.parseEventNameAndArgs.bind(this)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
const dbTx = await this._db.createTransactionRunner();
|
const dbTx = await this._db.createTransactionRunner();
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user