Skip to content

Commit 568e291

Browse files
committed
fix: linter
1 parent c69efcc commit 568e291

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

contracts/scripts/disputeRelayerBot.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import env from "./utils/env";
22
import loggerFactory from "./utils/logger";
3-
import { BigNumber } from "ethers";
43
import hre = require("hardhat");
54
import {
65
KlerosCore,
@@ -63,17 +62,19 @@ export default async function main(
6362
logger.info(
6463
`CrossChainDisputeOutgoing: ${foreignBlockHash} ${foreignArbitrable} ${foreignDisputeID} ${choices} ${extraData}`
6564
);
66-
// logger.info(`tx receipt: ${JSON.stringify(txReceipt)}`);
65+
logger.debug(`tx receipt: ${JSON.stringify(txReceipt)}`);
6766

6867
// txReceipt is missing the full logs for this tx so we need to request it here
6968
const fullTxReceipt = await foreignChainProvider.getTransactionReceipt(txReceipt.transactionHash);
7069

7170
// Retrieve the DisputeRequest event
72-
const disputeRequest = fullTxReceipt.logs
71+
const disputeRequests: DisputeRequestEventObject[] = fullTxReceipt.logs
7372
.filter((log) => log.topics[0] === arbitrableInterface.getEventTopic("DisputeRequest"))
74-
.map((log) => arbitrableInterface.parseLog(log).args as unknown as DisputeRequestEventObject)[0];
73+
.map((log) => arbitrableInterface.parseLog(log).args as unknown as DisputeRequestEventObject);
74+
logger.warn(`More than 1 DisputeRequest event: not supported yet, skipping the others events.`);
75+
76+
const disputeRequest = disputeRequests[0];
7577
logger.info(`tx events DisputeRequest: ${JSON.stringify(disputeRequest)}`);
76-
// TODO: log a warning if there are multiple DisputeRequest events
7778

7879
const relayCreateDisputeParams = {
7980
foreignBlockHash: foreignBlockHash,

contracts/scripts/keeperBot.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,9 @@ async function main() {
581581
});
582582
// Remove duplicates which may have a different contribution amount for the same round, choice and beneficiary
583583
contributions = [...new Set(contributions)];
584-
for (var contribution of contributions) {
584+
for (let contribution of contributions) {
585585
// Could be improved by pinpointing exactly which round requires a withdrawal, just try all of them for now.
586-
for (var round = BigNumber.from(dispute.currentRoundIndex); round.gte(0); round = round.sub(1)) {
586+
for (let round = BigNumber.from(dispute.currentRoundIndex); round.gte(0); round = round.sub(1)) {
587587
await withdrawAppealContribution(dispute.id, round.toString(), contribution);
588588
await delay(ITERATIONS_COOLDOWN_PERIOD); // To avoid spiking the gas price
589589
}

services/bots/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM node:16-alpine
22

33
WORKDIR /usr/src/app
44

5-
RUN npm install -g pm2
5+
RUN npm install --ignore-scripts -g pm2
66

77
COPY --chown=node:node "./contracts" "./contracts"
88
COPY --chown=node:node "./eslint-config" "./eslint-config"

0 commit comments

Comments
 (0)