Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JSHan94 committed May 12, 2024
1 parent c52b744 commit d110f81
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/lib/monitor/l1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ExecutorDepositTxEntity,
ExecutorUnconfirmedTxEntity,
ExecutorOutputEntity,
StateEntity,
StateEntity
} from '../../orm'
import { EntityManager } from 'typeorm'
import { RPCClient, RPCSocket } from '../rpc'
Expand Down Expand Up @@ -64,7 +64,7 @@ export class L1Monitor extends Monitor {
public async prepareMonitor(): Promise<void> {
const state = await this.db.getRepository(StateEntity).findOne({
where: {
name: "oracle_height"
name: 'oracle_height'
}
})
this.oracleHeight = state?.height || 0
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/lib/monitor/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ export abstract class Monitor {
public async monitor(): Promise<void> {
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(
Expand Down
3 changes: 1 addition & 2 deletions src/lib/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export class RPCSocket {
curRPCUrlIndex: number
retry = 0


constructor(
public rpcUrls: string[],
public interval: number,
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit d110f81

Please sign in to comment.