Refactor graph-node database and move to util (#259)

* Move graph-database from graph-node to util

* Refactor and remove graph-node dependency from cli package

* Modify dependencies using depcheck

* Implement CLI refactoring changes in other watchers

* Review changes to remove eden comment and fix local import in util

* Import GraphDatabase from util instead of graph-node

* Move graph-node non assemblyscript code to util package

* Implement CLI refactoring changes in codegen

* Fix graph-node tests after refactoring

* Move fromStateEntityValues to graph state utils
This commit is contained in:
2022-11-25 15:54:35 +05:30
committed by GitHub
parent 63a2c5804e
commit b66dcb4af9
105 changed files with 1120 additions and 428 deletions
+3 -5
View File
@@ -3,12 +3,10 @@
//
import { BaseProvider } from '@ethersproject/providers';
import { getCustomProvider, Database as BaseDatabase, ServerConfig } from '@cerc-io/util';
import { getCustomProvider, Database as BaseDatabase, ServerConfig, GraphDatabase, EventData } from '@cerc-io/util';
import { EthClient } from '@cerc-io/ipld-eth-client';
import { StorageLayout } from '@cerc-io/solidity-mapper';
import { EventData } from '../../src/utils';
import { Database } from '../../src/database';
import { Indexer } from './indexer';
const NETWORK_URL = 'http://127.0.0.1:8081';
@@ -70,10 +68,10 @@ export const getDummyGraphData = (): any => {
};
};
export const getTestDatabase = (): Database => {
export const getTestDatabase = (): GraphDatabase => {
const baseDatabase = new BaseDatabase({ type: 'postgres' });
const serverConfig = {} as ServerConfig;
return new Database(serverConfig, baseDatabase);
return new GraphDatabase(serverConfig, baseDatabase);
};
export const getTestIndexer = (storageLayout?: Map<string, StorageLayout>): Indexer => {