Skip to content

Commit

Permalink
Upgrade TypeScript, ESLint and GraphQL packages to be compatible with…
Browse files Browse the repository at this point in the history
… watcher-ts (#423)

* Update graphql dependency version

* Update watcher-ts to v0.2.33

* Update Typescript and ESLint

---------

Co-authored-by: Dhruv Srivastava <[email protected]>
  • Loading branch information
nikugogoi and dafaqdhruv authored Mar 28, 2023
1 parent 6461df3 commit 644229b
Show file tree
Hide file tree
Showing 66 changed files with 2,923 additions and 1,019 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM node:16.13.1-alpine3.14
FROM node:18.15.0-alpine3.16

WORKDIR /app

COPY . .

RUN apk --update --no-cache add git && yarn

22 changes: 11 additions & 11 deletions packages/erc20-watcher/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
"homepage": "https://github.com/vulcanize/watcher-ts#readme",
"dependencies": {
"@apollo/client": "^3.3.19",
"@cerc-io/cli": "^0.2.18",
"@cerc-io/ipld-eth-client": "^0.2.18",
"@cerc-io/solidity-mapper": "^0.2.18",
"@cerc-io/util": "^0.2.18",
"@cerc-io/cli": "^0.2.33",
"@cerc-io/ipld-eth-client": "^0.2.33",
"@cerc-io/solidity-mapper": "^0.2.33",
"@cerc-io/util": "^0.2.33",
"@vulcanize/util": "^0.1.0",
"apollo-type-bigint": "^0.1.3",
"debug": "^4.3.1",
Expand All @@ -59,14 +59,14 @@
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@types/debug": "^4.1.7",
"@types/json-bigint": "^1.0.0",
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"eslint": "^7.27.0",
"eslint-config-semistandard": "^15.0.1",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.3",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"eslint": "^8.36.0",
"eslint-config-semistandard": "^17.0.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-standard": "^5.0.0",
"hardhat": "^2.3.0",
"nodemon": "^2.0.7"
Expand Down
4 changes: 2 additions & 2 deletions packages/erc20-watcher/src/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { State } from './entity/State';
import { StateSyncStatus } from './entity/StateSyncStatus';

export class Database implements DatabaseInterface {
_config: ConnectionOptions
_conn!: Connection
_config: ConnectionOptions;
_conn!: Connection;
_baseDatabase: BaseDatabase;

constructor (config: ConnectionOptions) {
Expand Down
16 changes: 8 additions & 8 deletions packages/erc20-watcher/src/entity/Allowance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import { bigintTransformer } from '@cerc-io/util';
@Index(['blockHash', 'token', 'owner', 'spender'], { unique: true })
export class Allowance {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('varchar', { length: 42 })
token!: string;
token!: string;

@Column('varchar', { length: 42 })
owner!: string;
owner!: string;

@Column('varchar', { length: 42 })
spender!: string;
spender!: string;

@Column('numeric', { transformer: bigintTransformer })
value!: bigint;
value!: bigint;

@Column('text', { nullable: true })
proof!: string;
proof!: string;
}
14 changes: 7 additions & 7 deletions packages/erc20-watcher/src/entity/Balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import { bigintTransformer } from '@cerc-io/util';
@Index(['blockHash', 'token', 'owner'], { unique: true })
export class Balance {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('varchar', { length: 42 })
token!: string;
token!: string;

@Column('varchar', { length: 42 })
owner!: string;
owner!: string;

@Column('numeric', { transformer: bigintTransformer })
value!: bigint;
value!: bigint;

@Column('text', { nullable: true })
proof!: string;
proof!: string;
}
24 changes: 12 additions & 12 deletions packages/erc20-watcher/src/entity/BlockProgress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ import { BlockProgressInterface } from '@cerc-io/util';
@Index(['parentHash'])
export class BlockProgress implements BlockProgressInterface {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar')
cid!: string;
cid!: string;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('varchar', { length: 66 })
parentHash!: string;
parentHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('integer')
blockTimestamp!: number;
blockTimestamp!: number;

@Column('integer')
numEvents!: number;
numEvents!: number;

@Column('integer', { default: 0 })
numProcessedEvents!: number;
numProcessedEvents!: number;

@Column('integer', { default: -1 })
lastProcessedEventIndex!: number;
lastProcessedEventIndex!: number;

@Column('boolean')
isComplete!: boolean
isComplete!: boolean;

@Column('boolean', { default: false })
isPruned!: boolean
isPruned!: boolean;

@CreateDateColumn()
createdAt!: Date;
createdAt!: Date;
}
10 changes: 5 additions & 5 deletions packages/erc20-watcher/src/entity/Contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
@Index(['address'], { unique: true })
export class Contract {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 42 })
address!: string;
address!: string;

@Column('varchar', { length: 8 })
kind!: string;
kind!: string;

@Column('boolean', { default: false })
checkpoint!: boolean;
checkpoint!: boolean;

@Column('integer')
startingBlock!: number;
startingBlock!: number;
}
12 changes: 6 additions & 6 deletions packages/erc20-watcher/src/entity/Decimals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
@Index(['blockHash', 'token'], { unique: true })
export class Decimals {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('varchar', { length: 42 })
token!: string;
token!: string;

@Column('integer')
value!: number;
value!: number;

@Column('text', { nullable: true })
proof!: string;
proof!: string;
}
18 changes: 9 additions & 9 deletions packages/erc20-watcher/src/entity/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ import { BlockProgress } from './BlockProgress';
@Index(['block', 'contract', 'eventName'])
export class Event {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@ManyToOne(() => BlockProgress, { onDelete: 'CASCADE' })
block!: BlockProgress;
block!: BlockProgress;

@Column('varchar', { length: 66 })
txHash!: string;
txHash!: string;

// Index of the log in the block.
@Column('integer')
index!: number;
index!: number;

@Column('varchar', { length: 42 })
contract!: string;
contract!: string;

@Column('varchar', { length: 256 })
eventName!: string;
eventName!: string;

@Column('text')
eventInfo!: string;
eventInfo!: string;

@Column('text')
extraInfo!: string;
extraInfo!: string;

@Column('text')
proof!: string;
proof!: string;
}
12 changes: 6 additions & 6 deletions packages/erc20-watcher/src/entity/Name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
@Index(['blockHash', 'token'], { unique: true })
export class Name {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('varchar', { length: 42 })
token!: string;
token!: string;

@Column('varchar')
value!: string;
value!: string;

@Column('text', { nullable: true })
proof!: string;
proof!: string;
}
12 changes: 6 additions & 6 deletions packages/erc20-watcher/src/entity/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ import { BlockProgress } from './BlockProgress';
@Index(['block', 'contractAddress', 'kind'], { unique: true })
export class State {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@ManyToOne(() => BlockProgress, { onDelete: 'CASCADE' })
block!: BlockProgress;
block!: BlockProgress;

@Column('varchar', { length: 42 })
contractAddress!: string;
contractAddress!: string;

@Column('varchar')
cid!: string;
cid!: string;

@Column({
type: 'enum',
enum: StateKind
})
kind!: StateKind;
kind!: StateKind;

@Column('bytea')
data!: Buffer;
data!: Buffer;
}
6 changes: 3 additions & 3 deletions packages/erc20-watcher/src/entity/StateSyncStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
@Entity()
export class StateSyncStatus {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('integer')
latestIndexedBlockNumber!: number;
latestIndexedBlockNumber!: number;

@Column('integer', { nullable: true })
latestCheckpointBlockNumber!: number;
latestCheckpointBlockNumber!: number;
}
12 changes: 6 additions & 6 deletions packages/erc20-watcher/src/entity/Symbol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
@Index(['blockHash', 'token'], { unique: true })
export class Symbol {
@PrimaryGeneratedColumn()
id!: number;
id!: number;

@Column('varchar', { length: 66 })
blockHash!: string;
blockHash!: string;

@Column('integer')
blockNumber!: number;
blockNumber!: number;

@Column('varchar', { length: 42 })
token!: string;
token!: string;

@Column('varchar')
value!: string;
value!: string;

@Column('text', { nullable: true })
proof!: string;
proof!: string;
}
Loading

0 comments on commit 644229b

Please sign in to comment.