Skip to content

Commit 9affefb

Browse files
Mani BrarMani Brar
authored andcommitted
chore(validator): add params as object
1 parent 62f36b8 commit 9affefb

File tree

1 file changed

+27
-15
lines changed

1 file changed

+27
-15
lines changed

validator-cli/src/watcher.ts

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async function processNetwork(
7575
toWatch[networkKey] = epochRange;
7676
}
7777

78-
await processEpochsForNetwork(
78+
await processEpochsForNetwork({
7979
chainId,
8080
path,
8181
networkKey,
@@ -85,8 +85,8 @@ async function processNetwork(
8585
outboxRPC,
8686
toWatch,
8787
transactionHandlers,
88-
emitter
89-
);
88+
emitter,
89+
});
9090
const currentLatestBlock = await veaOutboxProvider.getBlock("latest");
9191
const currentLatestEpoch = Math.floor(currentLatestBlock.timestamp / routeConfig[network].epochPeriod);
9292
const toWatchEpochs = toWatch[networkKey];
@@ -97,18 +97,30 @@ async function processNetwork(
9797
}
9898
}
9999

100-
async function processEpochsForNetwork(
101-
chainId: number,
102-
path: number,
103-
networkKey: string,
104-
network: Network,
105-
routeConfig: any,
106-
inboxRPC: string,
107-
outboxRPC: string,
108-
toWatch: { [key: string]: number[] },
109-
transactionHandlers: { [epoch: number]: any },
110-
emitter: typeof defaultEmitter
111-
) {
100+
interface ProcessEpochParams {
101+
chainId: number;
102+
path: number;
103+
networkKey: string;
104+
network: Network;
105+
routeConfig: any;
106+
inboxRPC: string;
107+
outboxRPC: string;
108+
toWatch: { [key: string]: number[] };
109+
transactionHandlers: { [epoch: number]: any };
110+
emitter: typeof defaultEmitter;
111+
}
112+
async function processEpochsForNetwork({
113+
chainId,
114+
path,
115+
networkKey,
116+
network,
117+
routeConfig,
118+
inboxRPC,
119+
outboxRPC,
120+
toWatch,
121+
transactionHandlers,
122+
emitter,
123+
}: ProcessEpochParams) {
112124
const privKey = process.env.PRIVATE_KEY;
113125
const veaInbox = getVeaInbox(routeConfig[network].veaInbox.address, privKey, inboxRPC, chainId, network);
114126
const veaOutbox = getVeaOutbox(routeConfig[network].veaOutbox.address, privKey, outboxRPC, chainId, network);

0 commit comments

Comments
 (0)