Skip to content

Commit

Permalink
remove redundant methods
Browse files Browse the repository at this point in the history
  • Loading branch information
r0wdy1 committed Aug 7, 2024
1 parent f6f04e1 commit 3c91321
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
6 changes: 0 additions & 6 deletions zp-relayer/lib/network/evm/EvmContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,4 @@ export class EthereumContract implements INetworkContract {
)
}

getEvents(event: string) {
return this.instance.getPastEvents(event, {
fromBlock: 0,
toBlock: 'latest',
})
}
}
11 changes: 0 additions & 11 deletions zp-relayer/lib/network/tron/TronContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,4 @@ export class TronContract implements INetworkContract {
return this.instance[method](...args).call()
}

async getEvents(eventName: string) {
const res = await this.instance._getEvents({
eventName,
size: 0,
onlyConfirmed: true,
})
return res.map((e: any) => ({
returnValues: e.result,
transactionHash: e.transaction,
}))
}
}
1 change: 0 additions & 1 deletion zp-relayer/lib/network/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,4 @@ export interface INetworkContract {
address(): string
call(method: string, args: any[]): Promise<any>
callRetry(method: string, args: any[]): Promise<any>
getEvents(event: string): Promise<any[]>
}
19 changes: 0 additions & 19 deletions zp-relayer/services/commitment-watcher/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,6 @@ export function createRouter(pool: BasePool) {
res.json({ fee: fee.toString(10) })
})

router.get('/job/:commitment', async (req, res) => {
const jobId = req.params.commitment
const job = await poolTxQueue.getJob(jobId)
if (job) {
const { outCommit, privilegedProver, fee, timestamp, gracePeriodEnd, txHash, state } = job.data
.transaction as WorkerTx<WorkerTxType.Finalize>
res.json({
outCommit,
privilegedProver,
fee,
timestamp,
gracePeriodEnd,
txHash,
state,
})
} else {
res.json(`Job ${jobId} not found`)
}
})

// Error handler middleware
router.use((error: any, req: Request, res: Response, next: NextFunction) => {
Expand Down

0 comments on commit 3c91321

Please sign in to comment.