Fix eth_calls with blockHash (#287)

* Fix eth_calls with blockHash

* Use blockHash in erc20 eth_calls
This commit is contained in:
2021-10-25 19:51:16 +05:30
committed by GitHub
parent 737d9a9b6e
commit 137f7d1a21
17 changed files with 77 additions and 55 deletions
@@ -8,11 +8,10 @@ import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import debug from 'debug';
import { PubSub } from 'apollo-server-express';
import { getDefaultProvider } from 'ethers';
import { getCache } from '@vulcanize/cache';
import { EthClient } from '@vulcanize/ipld-eth-client';
import { getConfig, fillBlocks, JobQueue, DEFAULT_CONFIG_PATH } from '@vulcanize/util';
import { getConfig, fillBlocks, JobQueue, DEFAULT_CONFIG_PATH, getCustomProvider } from '@vulcanize/util';
import { Database } from './database';
import { Indexer } from './indexer';
@@ -71,7 +70,7 @@ export const main = async (): Promise<any> => {
cache
});
const ethProvider = getDefaultProvider(rpcProviderEndpoint);
const ethProvider = getCustomProvider(rpcProviderEndpoint);
// Note: In-memory pubsub works fine for now, as each watcher is a single process anyway.
// Later: https://www.apollographql.com/docs/apollo-server/data/subscriptions/#production-pubsub-libraries
@@ -7,7 +7,6 @@ import 'reflect-metadata';
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
import debug from 'debug';
import { getDefaultProvider } from 'ethers';
import { getCache } from '@vulcanize/cache';
import { EthClient } from '@vulcanize/ipld-eth-client';
@@ -18,7 +17,8 @@ import {
QUEUE_BLOCK_PROCESSING,
QUEUE_EVENT_PROCESSING,
JobQueueConfig,
DEFAULT_CONFIG_PATH
DEFAULT_CONFIG_PATH,
getCustomProvider
} from '@vulcanize/util';
import { Indexer } from './indexer';
@@ -106,7 +106,7 @@ export const main = async (): Promise<any> => {
cache
});
const ethProvider = getDefaultProvider(rpcProviderEndpoint);
const ethProvider = getCustomProvider(rpcProviderEndpoint);
const indexer = new Indexer(db, ethClient, postgraphileClient, ethProvider);
assert(jobQueueConfig, 'Missing job queue config');
@@ -13,11 +13,10 @@ import { hideBin } from 'yargs/helpers';
import debug from 'debug';
import 'graphql-import-node';
import { createServer } from 'http';
import { getDefaultProvider } from 'ethers';
import { getCache } from '@vulcanize/cache';
import { EthClient } from '@vulcanize/ipld-eth-client';
import { DEFAULT_CONFIG_PATH, getConfig, JobQueue, KIND_ACTIVE } from '@vulcanize/util';
import { DEFAULT_CONFIG_PATH, getConfig, JobQueue, KIND_ACTIVE, getCustomProvider } from '@vulcanize/util';
import { createResolvers } from './resolvers';
import { Indexer } from './indexer';
@@ -68,7 +67,7 @@ export const main = async (): Promise<any> => {
cache
});
const ethProvider = getDefaultProvider(rpcProviderEndpoint);
const ethProvider = getCustomProvider(rpcProviderEndpoint);
const indexer = new Indexer(db, ethClient, postgraphileClient, ethProvider);