Upgrade Typescript and ESLint (#337) (#342)

* Upgrade eslint and additional lint changes

* Upgrade typescript version to v5

---------

Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
This commit is contained in:
Nabarun Gogoi 2023-03-24 12:01:33 +05:30 committed by GitHub
parent 0f239c360e
commit ee63e33cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
98 changed files with 675 additions and 441 deletions

View File

@ -1,4 +1,4 @@
FROM node:16.13.1-alpine3.14
FROM node:18.15.0-alpine3.16
WORKDIR /app

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -51,10 +51,10 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"chai": "^4.3.4",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",

View File

@ -12,8 +12,8 @@ import { BlockProgress } from './entity/BlockProgress';
import { Trace } from './entity/Trace';
export class Database {
_config: ConnectionOptions
_conn!: Connection
_config: ConnectionOptions;
_conn!: Connection;
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -20,5 +20,5 @@ export class BlockProgress {
numTracedTx!: number;
@Column('boolean')
isComplete!: boolean
isComplete!: boolean;
}

View File

@ -23,5 +23,5 @@ export class Trace {
trace!: string;
@ManyToMany(() => Account, account => account.appearances, { eager: true, cascade: ['insert'] })
accounts: Account[]
accounts: Account[];
}

View File

@ -19,10 +19,10 @@ import { BlockProgress } from './entity/BlockProgress';
const log = debug('vulcanize:indexer');
export class Indexer {
_db: Database
_ethClient: EthClient
_getStorageAt: GetStorageAt
_tracingClient: TracingClient
_db: Database;
_ethClient: EthClient;
_getStorageAt: GetStorageAt;
_tracingClient: TracingClient;
constructor (db: Database, ethClient: EthClient, tracingClient: TracingClient) {
assert(db);

View File

@ -19,11 +19,11 @@ export const BlockProgressEvent = 'block-progress-event';
export const QUEUE_TX_TRACING = 'tx-tracing';
export class TxWatcher {
_ethClient: EthClient
_indexer: Indexer
_pubsub: PubSub
_watchTxSubscription: ZenObservable.Subscription | undefined
_jobQueue: JobQueue
_ethClient: EthClient;
_indexer: Indexer;
_pubsub: PubSub;
_watchTxSubscription: ZenObservable.Subscription | undefined;
_jobQueue: JobQueue;
constructor (ethClient: EthClient, indexer: Indexer, pubsub: PubSub, jobQueue: JobQueue) {
this._ethClient = ethClient;

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"error",

View File

@ -31,10 +31,10 @@
"@types/level": "^6.0.0",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0"

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -32,10 +32,10 @@
"@typescript-eslint/parser": "^5.47.1",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^5.0.0",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"typescript": "^4.9.4"
"typescript": "^5.0.2"
}
}

View File

@ -25,7 +25,7 @@ export class BaseCmd {
_config?: Config;
_clients?: Clients;
_ethProvider?: JsonRpcProvider;
_jobQueue?: JobQueue
_jobQueue?: JobQueue;
_database?: DatabaseInterface;
_indexer?: IndexerInterface;
_eventWatcher?: EventWatcher;

View File

@ -29,8 +29,8 @@ interface Arguments {
}
export class CreateCheckpointCmd {
_argv?: Arguments
_baseCmd: BaseCmd
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {
this._baseCmd = new BaseCmd();

View File

@ -30,8 +30,8 @@ interface Arguments {
}
export class VerifyCheckpointCmd {
_argv?: Arguments
_baseCmd: BaseCmd
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {
this._baseCmd = new BaseCmd();

View File

@ -34,7 +34,7 @@ interface Arguments {
}
export class ExportStateCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -37,7 +37,7 @@ interface Arguments {
}
export class FillCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -36,7 +36,7 @@ interface Arguments {
}
export class ImportStateCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -31,7 +31,7 @@ interface Arguments {
}
export class InspectCIDCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -29,7 +29,7 @@ interface Arguments {
}
export class JobRunnerCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -22,9 +22,9 @@ interface Arguments {
}
export class ResetStateCmd {
_argv?: Arguments
_argv?: Arguments;
_config?: Config;
_database?: DatabaseInterface
_database?: DatabaseInterface;
async initConfig (configFile: string): Promise<Config> {
this._config = await getConfig(configFile);

View File

@ -28,7 +28,7 @@ interface Arguments {
}
export class ResetWatcherCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -45,7 +45,7 @@ interface Arguments {
}
export class ServerCmd {
_argv?: Arguments
_argv?: Arguments;
_baseCmd: BaseCmd;
constructor () {

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -34,7 +34,7 @@
"node-fetch": "^2",
"solc": "0.8.13",
"ts-node": "^10.2.1",
"typescript": "^4.3.2",
"typescript": "^5.0.2",
"yargs": "^17.1.1"
},
"devDependencies": {
@ -43,10 +43,10 @@
"@types/node": "^16.9.0",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0"
}

View File

@ -66,7 +66,7 @@
"eslint": "^7.27.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -59,14 +59,14 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"copyfiles": "^2.4.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -25,5 +25,5 @@ export class Account {
totalSlashed!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -63,5 +63,5 @@ export class Block {
size!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -34,5 +34,5 @@ export class Claim {
claimed!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -34,5 +34,5 @@ export class Distribution {
metadataURI!: string;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -20,5 +20,5 @@ export class Distributor {
currentDistribution!: string;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -41,5 +41,5 @@ export class Epoch {
producerBlocksRatio!: Decimal;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -41,5 +41,5 @@ export class Network {
stakedPercentiles!: bigint[];
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -33,5 +33,5 @@ export class Producer {
pendingEpochBlocks!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -35,5 +35,5 @@ export class ProducerEpoch {
blocksProducedRatio!: Decimal;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -27,5 +27,5 @@ export class ProducerRewardCollectorChange {
rewardCollector!: string;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -20,5 +20,5 @@ export class ProducerSet {
producers!: string[];
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -35,5 +35,5 @@ export class ProducerSetChange {
changeType!: ProducerSetChangeType;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -29,5 +29,5 @@ export class RewardSchedule {
activeRewardScheduleEntry!: string;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -27,5 +27,5 @@ export class RewardScheduleEntry {
rewardsPerEpoch!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -28,5 +28,5 @@ export class Slash {
slashed!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -41,5 +41,5 @@ export class Slot {
taxRatePerDay!: Decimal;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -41,5 +41,5 @@ export class SlotClaim {
taxRatePerDay!: Decimal;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -24,5 +24,5 @@ export class Staker {
rank!: bigint;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -66,21 +66,21 @@ const KIND_MERKLEDISTRIBUTOR = 'EdenNetworkDistribution';
const KIND_DISTRIBUTORGOVERNANCE = 'EdenNetworkGovernance';
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: BaseProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: BaseProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_graphWatcher: GraphWatcher;
_abiMap: Map<string, JsonFragment[]>
_storageLayoutMap: Map<string, StorageLayout>
_contractMap: Map<string, ethers.utils.Interface>
_abiMap: Map<string, JsonFragment[]>;
_storageLayoutMap: Map<string, StorageLayout>;
_contractMap: Map<string, ethers.utils.Interface>;
_entityTypesMap: Map<string, { [key: string]: string }>
_relationsMap: Map<any, { [key: string]: any }>
_entityTypesMap: Map<string, { [key: string]: string }>;
_relationsMap: Map<any, { [key: string]: any }>;
_subgraphStateMap: Map<string, any>
_subgraphStateMap: Map<string, any>;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
assert(db);

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -64,10 +64,10 @@
"@types/json-bigint": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",

View File

@ -20,8 +20,8 @@ import { StateSyncStatus } from './entity/StateSyncStatus';
export const ENTITIES = [Allowance, Balance];
export class Database implements DatabaseInterface {
_config: ConnectionOptions
_conn!: Connection
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;
constructor (config: ConnectionOptions) {

View File

@ -39,10 +39,10 @@ export class BlockProgress implements BlockProgressInterface {
lastProcessedEventIndex!: number;
@Column('boolean')
isComplete!: boolean
isComplete!: boolean;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
@CreateDateColumn()
createdAt!: Date;

View File

@ -61,16 +61,16 @@ interface EventResult {
}
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: BaseProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: BaseProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_abi: JsonFragment[]
_storageLayout: StorageLayout
_contract: ethers.utils.Interface
_serverMode: string
_abi: JsonFragment[];
_storageLayout: StorageLayout;
_contract: ethers.utils.Interface;
_serverMode: string;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
assert(db);

View File

@ -6,10 +6,10 @@ import { utils } from 'ethers';
// Initialize a Token Definition with the attributes.
export class StaticTokenDefinition {
address : string
symbol: string
name: string
decimals: bigint
address : string;
symbol: string;
name: string;
decimals: bigint;
// Initialize a Token Definition with its attributes.
constructor (address: string, symbol: string, name: string, decimals: bigint) {

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -71,15 +71,15 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"copyfiles": "^2.4.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"hardhat": "^2.3.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -36,7 +36,7 @@ export class Database implements DatabaseInterface {
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;
_propColMaps: { [key: string]: Map<string, string>; }
_propColMaps: { [key: string]: Map<string, string>; };
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -19,5 +19,5 @@ export class TransferCount {
count!: number;
@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;
}

View File

@ -48,15 +48,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
const KIND_ERC721 = 'ERC721';
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: BaseProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: BaseProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_abiMap: Map<string, JsonFragment[]>
_storageLayoutMap: Map<string, StorageLayout>
_contractMap: Map<string, ethers.utils.Interface>
_abiMap: Map<string, JsonFragment[]>;
_storageLayoutMap: Map<string, StorageLayout>;
_contractMap: Map<string, ethers.utils.Interface>;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue) {
assert(db);

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off"
}

View File

@ -62,7 +62,7 @@ export class Foo {
export const FooID = idof<Foo>();
export class Bar {
prop: string
prop: string;
constructor (prop: string) {
this.prop = prop;

View File

@ -16,10 +16,10 @@
"@typescript-eslint/parser": "^5.47.1",
"chai": "^4.3.4",
"chai-spies": "^1.0.0",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
@ -28,7 +28,7 @@
"mocha": "^8.4.0",
"nodemon": "^2.0.7",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
},
"bin": {
"compare-entity": "bin/compare-entity"

View File

@ -50,7 +50,7 @@ export class GraphWatcher {
_wasmRestartBlocksInterval: number;
_dataSources: any[] = [];
_dataSourceMap: { [key: string]: DataSource } = {};
_transactionsMap: Map<string, Transaction> = new Map()
_transactionsMap: Map<string, Transaction> = new Map();
_context: Context = {};

View File

@ -23,7 +23,7 @@ import { GetStorageAt, getStorageValue, MappingKey, StorageLayout } from '@cerc-
export class Indexer implements IndexerInterface {
_getStorageAt: GetStorageAt;
_storageLayoutMap: Map<string, StorageLayout> = new Map()
_storageLayoutMap: Map<string, StorageLayout> = new Map();
constructor (ethClient: EthClient, storageLayoutMap?: Map<string, StorageLayout>) {
this._getStorageAt = ethClient.getStorageAt.bind(ethClient);

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -60,14 +60,14 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"copyfiles": "^2.4.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -30,7 +30,7 @@ export class Database implements DatabaseInterface {
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;
_propColMaps: { [key: string]: Map<string, string>; }
_propColMaps: { [key: string]: Map<string, string>; };
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -28,10 +28,10 @@ export class Blog {
enum: BlogType,
default: BlogType.short
})
kind!: BlogType
kind!: BlogType;
@Column('boolean')
isActive!: boolean
isActive!: boolean;
@Column('numeric', { transformer: bigintArrayTransformer, array: true })
reviews!: bigint[];

View File

@ -55,21 +55,21 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
const KIND_EXAMPLE1 = 'Example1';
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: BaseProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: BaseProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_graphWatcher: GraphWatcher;
_abiMap: Map<string, JsonFragment[]>
_storageLayoutMap: Map<string, StorageLayout>
_contractMap: Map<string, ethers.utils.Interface>
_abiMap: Map<string, JsonFragment[]>;
_storageLayoutMap: Map<string, StorageLayout>;
_contractMap: Map<string, ethers.utils.Interface>;
_entityTypesMap: Map<string, { [key: string]: string }>
_relationsMap: Map<any, { [key: string]: any }>
_entityTypesMap: Map<string, { [key: string]: string }>;
_relationsMap: Map<any, { [key: string]: any }>;
_subgraphStateMap: Map<string, any>
_subgraphStateMap: Map<string, any>;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: BaseProvider, jobQueue: JobQueue, graphWatcher?: GraphWatcherInterface) {
assert(db);

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -34,10 +34,10 @@
"@types/ws": "^8.5.3",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0"

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -61,14 +61,14 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"copyfiles": "^2.4.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -26,7 +26,7 @@ export class Database implements DatabaseInterface {
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;
_propColMaps: { [key: string]: Map<string, string>; }
_propColMaps: { [key: string]: Map<string, string>; };
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -53,15 +53,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: JsonRpcProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: JsonRpcProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_abiMap: Map<string, JsonFragment[]>
_storageLayoutMap: Map<string, StorageLayout>
_contractMap: Map<string, ethers.utils.Interface>
_abiMap: Map<string, JsonFragment[]>;
_storageLayoutMap: Map<string, StorageLayout>;
_contractMap: Map<string, ethers.utils.Interface>;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
assert(db);

View File

@ -7,7 +7,6 @@ import { Config, DEFAULT_CONFIG_PATH, getConfig, initClients } from '@cerc-io/ut
import {
PeerInitConfig,
PeerIdObj
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1319854183
} from '@cerc-io/peer';
import { getCurrentTime, sendMessageToL2 } from './libp2p-utils';

View File

@ -44,7 +44,7 @@
// "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
/* Module Resolution Options */
"moduleResolution": "Node16", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -58,14 +58,14 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"copyfiles": "^2.4.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -26,7 +26,7 @@ export class Database implements DatabaseInterface {
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;
_propColMaps: { [key: string]: Map<string, string>; }
_propColMaps: { [key: string]: Map<string, string>; };
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -53,15 +53,15 @@ const JSONbigNative = JSONbig({ useNativeBigInt: true });
export const KIND_PHISHERREGISTRY = 'PhisherRegistry';
export class Indexer implements IndexerInterface {
_db: Database
_ethClient: EthClient
_ethProvider: JsonRpcProvider
_baseIndexer: BaseIndexer
_serverConfig: ServerConfig
_db: Database;
_ethClient: EthClient;
_ethProvider: JsonRpcProvider;
_baseIndexer: BaseIndexer;
_serverConfig: ServerConfig;
_abiMap: Map<string, JsonFragment[]>
_storageLayoutMap: Map<string, StorageLayout>
_contractMap: Map<string, ethers.utils.Interface>
_abiMap: Map<string, JsonFragment[]>;
_storageLayoutMap: Map<string, StorageLayout>;
_contractMap: Map<string, ethers.utils.Interface>;
constructor (serverConfig: ServerConfig, db: DatabaseInterface, clients: Clients, ethProvider: JsonRpcProvider, jobQueue: JobQueue) {
assert(db);

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}

View File

@ -5,7 +5,7 @@
"main": "dist/index.js",
"exports": "./dist/index.js",
"type": "module",
"license": "AGPL-version-3.0",
"license": "AGPL-3.0",
"private": false,
"engines": {
"node": ">=14.16",
@ -58,13 +58,13 @@
"@types/node": "16.11.7",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
"typescript": "^4.9.4"
"typescript": "^5.0.2"
}
}

View File

@ -28,7 +28,7 @@ export class PeerHearbeatChecker {
_node: Libp2p;
_pingInterval: number;
_pingTimeout: number;
_peerMap: Map<string, PeerData> = new Map()
_peerMap: Map<string, PeerData> = new Map();
constructor (node: Libp2p, options: Partial<PeerHearbeatCheckerOptions> = {}) {
this._node = node;

View File

@ -69,22 +69,22 @@ export interface PeerInitConfig {
}
export class Peer {
_node?: Libp2p
_peerHeartbeatChecker?: PeerHearbeatChecker
_webRTCSignallingEnabled: boolean
_node?: Libp2p;
_peerHeartbeatChecker?: PeerHearbeatChecker;
_webRTCSignallingEnabled: boolean;
_relayNodeMultiaddr: Multiaddr
_numRelayConnections = 0
_relayNodeMultiaddr: Multiaddr;
_numRelayConnections = 0;
_relayRedialInterval?: number
_maxRelayConnections?: number
_relayRedialInterval?: number;
_maxRelayConnections?: number;
_debugInfoEnabled?: boolean
_debugInfoEnabled?: boolean;
_peerStreamMap: Map<string, Pushable<any>> = new Map()
_messageHandlers: Array<(peerId: PeerId, message: any) => void> = []
_topicHandlers: Map<string, Array<(peerId: PeerId, data: any) => void>> = new Map()
_metrics = new PrometheusMetrics()
_peerStreamMap: Map<string, Pushable<any>> = new Map();
_messageHandlers: Array<(peerId: PeerId, message: any) => void> = [];
_topicHandlers: Map<string, Array<(peerId: PeerId, data: any) => void>> = new Map();
_metrics = new PrometheusMetrics();
constructor (relayNodeURL: string, nodejs?: boolean) {
this._webRTCSignallingEnabled = !(nodejs === true);

View File

@ -16,5 +16,6 @@
"@typescript-eslint"
],
"rules": {
"indent": "off"
}
}

View File

@ -12,10 +12,10 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"chai": "^4.3.4",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",
@ -23,7 +23,7 @@
"ethers": "^5.4.4",
"hardhat": "^2.3.0",
"lodash": "^4.17.21",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
},
"scripts": {
"lint": "eslint .",

View File

@ -18,6 +18,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off"
}
}

View File

@ -25,8 +25,8 @@
"@types/mocha": "^8.2.2",
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"ts-node": "^10.2.1",
"typescript": "^4.3.2"
"typescript": "^5.0.2"
}
}

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -26,10 +26,10 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0"

View File

@ -16,6 +16,7 @@
"@typescript-eslint"
],
"rules": {
"indent": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn",

View File

@ -48,10 +48,10 @@
"@typescript-eslint/eslint-plugin": "^5.47.1",
"@typescript-eslint/parser": "^5.47.1",
"decimal.js": "^10.3.1",
"eslint": "^7.27.0",
"eslint": "^8.35.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-standard": "^5.0.0",

View File

@ -68,9 +68,9 @@ export interface Where {
export type Relation = string | { property: string, alias: string }
export class Database {
_config: ConnectionOptions
_conn!: Connection
_pgPool: Pool
_config: ConnectionOptions;
_conn!: Connection;
_pgPool: Pool;
constructor (config: ConnectionOptions) {
assert(config);

View File

@ -21,13 +21,13 @@ const log = debug('vulcanize:events');
export const BlockProgressEvent = 'block-progress-event';
export class EventWatcher {
_ethClient: EthClient
_indexer: IndexerInterface
_pubsub: PubSub
_jobQueue: JobQueue
_ethClient: EthClient;
_indexer: IndexerInterface;
_pubsub: PubSub;
_jobQueue: JobQueue;
_shutDown = false
_signalCount = 0
_shutDown = false;
_signalCount = 0;
constructor (ethClient: EthClient, indexer: IndexerInterface, pubsub: PubSub, jobQueue: JobQueue) {
this._ethClient = ethClient;

View File

@ -54,16 +54,16 @@ interface CachedEntities {
}
export class GraphDatabase {
_serverConfig: ServerConfig
_conn!: Connection
_baseDatabase: BaseDatabase
_entityQueryTypeMap: Map<new() => any, ENTITY_QUERY_TYPE>
_entityToLatestEntityMap: Map<new () => any, new () => any> = new Map()
_serverConfig: ServerConfig;
_conn!: Connection;
_baseDatabase: BaseDatabase;
_entityQueryTypeMap: Map<new() => any, ENTITY_QUERY_TYPE>;
_entityToLatestEntityMap: Map<new () => any, new () => any> = new Map();
_cachedEntities: CachedEntities = {
frothyBlocks: new Map(),
latestPrunedEntities: new Map()
}
};
constructor (
serverConfig: ServerConfig,

View File

@ -5,7 +5,7 @@
import { create, IPFSHTTPClient } from 'ipfs-http-client';
export class IPFSClient {
_client: IPFSHTTPClient
_client: IPFSHTTPClient;
constructor (url: string) {
this._client = create({ url });

View File

@ -34,15 +34,15 @@ import { lastBlockNumEvents, lastBlockProcessDuration, lastProcessedBlockNumber
const log = debug('vulcanize:job-runner');
export class JobRunner {
jobQueue: JobQueue
_indexer: IndexerInterface
_jobQueueConfig: JobQueueConfig
_blockProcessStartTime?: Date
_endBlockProcessTimer?: () => void
_blockAndEventsMap: Map<string, PrefetchedBlock> = new Map()
jobQueue: JobQueue;
_indexer: IndexerInterface;
_jobQueueConfig: JobQueueConfig;
_blockProcessStartTime?: Date;
_endBlockProcessTimer?: () => void;
_blockAndEventsMap: Map<string, PrefetchedBlock> = new Map();
_shutDown = false
_signalCount = 0
_shutDown = false;
_signalCount = 0;
constructor (jobQueueConfig: JobQueueConfig, indexer: IndexerInterface, jobQueue: JobQueue) {
this._indexer = indexer;

694
yarn.lock

File diff suppressed because it is too large Load Diff