From d110f818cdf5660a63b528dfdfe935893c71ed8a Mon Sep 17 00:00:00 2001 From: JSHan94 Date: Sun, 12 May 2024 13:56:11 +0900 Subject: [PATCH] lint --- src/lib/monitor/l1.ts | 9 +++++---- src/lib/monitor/monitor.ts | 4 ++-- src/lib/rpc.ts | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/monitor/l1.ts b/src/lib/monitor/l1.ts index 78fe18c..43e1c19 100644 --- a/src/lib/monitor/l1.ts +++ b/src/lib/monitor/l1.ts @@ -11,7 +11,7 @@ import { ExecutorDepositTxEntity, ExecutorUnconfirmedTxEntity, ExecutorOutputEntity, - StateEntity, + StateEntity } from '../../orm' import { EntityManager } from 'typeorm' import { RPCClient, RPCSocket } from '../rpc' @@ -64,7 +64,7 @@ export class L1Monitor extends Monitor { public async prepareMonitor(): Promise { const state = await this.db.getRepository(StateEntity).findOne({ where: { - name: "oracle_height" + name: 'oracle_height' } }) this.oracleHeight = state?.height || 0 @@ -96,7 +96,8 @@ export class L1Monitor extends Monitor { const latestHeight = this.socket.latestHeight const latestTx0 = this.socket.latestTx0 - if (!latestHeight || !latestTx0 || this.oracleHeight == latestHeight) return + if (!latestHeight || !latestTx0 || this.oracleHeight == latestHeight) + return const msgs = [ new MsgUpdateOracle( @@ -117,7 +118,7 @@ export class L1Monitor extends Monitor { this.oracleHeight = latestHeight await this.db .getRepository(StateEntity) - .save({ name: "oracle_height", height: this.oracleHeight }) + .save({ name: 'oracle_height', height: this.oracleHeight }) } catch (err) { const errMsg = this.helper.extractErrorMessage(err) this.logger.error( diff --git a/src/lib/monitor/monitor.ts b/src/lib/monitor/monitor.ts index e84bf01..d077e20 100644 --- a/src/lib/monitor/monitor.ts +++ b/src/lib/monitor/monitor.ts @@ -71,10 +71,10 @@ export abstract class Monitor { public async monitor(): Promise { await this.prepareMonitor() while (this.isRunning) { - try{ + try { const latestHeight = this.socket.latestHeight if (!latestHeight || !(latestHeight > this.syncedHeight)) continue - + await this.handleNewBlock() const blockchainData = await this.rpcClient.getBlockchain( diff --git a/src/lib/rpc.ts b/src/lib/rpc.ts index be90617..860e574 100644 --- a/src/lib/rpc.ts +++ b/src/lib/rpc.ts @@ -18,7 +18,6 @@ export class RPCSocket { curRPCUrlIndex: number retry = 0 - constructor( public rpcUrls: string[], public interval: number, @@ -76,7 +75,7 @@ export class RPCSocket { const msg = `${this.constructor.name} is now alive. (downtime ${downtime} minutes)` this.logger.info(msg) this.isAlive = true - this.retry = 0 + this.retry = 0 } this.alivedAt = Date.now() }