From d75162e5fc66dda02d67953b4f89c4c4dc0d572e Mon Sep 17 00:00:00 2001 From: Pablo Maldonado Date: Sun, 3 Sep 2023 21:01:06 +0200 Subject: [PATCH] refactor: rename init monitoring params Signed-off-by: Pablo Maldonado --- .../llm-bot/src/dispute-bot/DisputeDisputableRequests.ts | 4 ++-- packages/llm-bot/src/dispute-bot/common.ts | 6 +++--- packages/llm-bot/src/dispute-bot/index.ts | 4 ++-- packages/llm-bot/test/OptimisticOracleV2LLM.ts | 8 -------- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/packages/llm-bot/src/dispute-bot/DisputeDisputableRequests.ts b/packages/llm-bot/src/dispute-bot/DisputeDisputableRequests.ts index 0fb9e49a64..854711478f 100644 --- a/packages/llm-bot/src/dispute-bot/DisputeDisputableRequests.ts +++ b/packages/llm-bot/src/dispute-bot/DisputeDisputableRequests.ts @@ -3,9 +3,9 @@ import { OptimisticOracleClientV2, OptimisticOracleClientV2FilterDisputeable, } from "../core/OptimisticOracleV2"; -import { Logger, MonitoringParams } from "./common"; +import { Logger, BotParams } from "./common"; -export async function disputeDisputableRequests(logger: typeof Logger, params: MonitoringParams): Promise { +export async function disputeDisputableRequests(logger: typeof Logger, params: BotParams): Promise { const oov2 = new OptimisticOracleClientV2(params.provider); // Update the client with the latest block range. diff --git a/packages/llm-bot/src/dispute-bot/common.ts b/packages/llm-bot/src/dispute-bot/common.ts index 5763fb9d18..dda32c4842 100644 --- a/packages/llm-bot/src/dispute-bot/common.ts +++ b/packages/llm-bot/src/dispute-bot/common.ts @@ -20,7 +20,7 @@ export interface BlockRange { end: number; } -export interface MonitoringParams { +export interface BotParams { chainId: number; provider: Provider; botModes: BotModes; @@ -30,7 +30,7 @@ export interface MonitoringParams { pollingDelay: number; } -export const initMonitoringParams = async (env: NodeJS.ProcessEnv): Promise => { +export const initBotParams = async (env: NodeJS.ProcessEnv): Promise => { if (!env.CHAIN_ID) throw new Error("CHAIN_ID must be defined in env"); const chainId = Number(env.CHAIN_ID); @@ -66,6 +66,6 @@ export const initMonitoringParams = async (env: NodeJS.ProcessEnv): Promise { +export const startupLogLevel = (params: BotParams): "debug" | "info" => { return params.pollingDelay === 0 ? "debug" : "info"; }; diff --git a/packages/llm-bot/src/dispute-bot/index.ts b/packages/llm-bot/src/dispute-bot/index.ts index 861a8b759b..0ca30bae0a 100644 --- a/packages/llm-bot/src/dispute-bot/index.ts +++ b/packages/llm-bot/src/dispute-bot/index.ts @@ -1,11 +1,11 @@ import { delay, waitForLogger } from "@uma/financial-templates-lib"; -import { BotModes, initMonitoringParams, Logger, startupLogLevel } from "./common"; +import { BotModes, initBotParams, Logger, startupLogLevel } from "./common"; import { disputeDisputableRequests } from "./DisputeDisputableRequests"; const logger = Logger; async function main() { - const params = await initMonitoringParams(process.env); + const params = await initBotParams(process.env); logger[startupLogLevel(params)]({ at: "LLMDisputeBot", diff --git a/packages/llm-bot/test/OptimisticOracleV2LLM.ts b/packages/llm-bot/test/OptimisticOracleV2LLM.ts index 5b5199fde0..f34af61205 100644 --- a/packages/llm-bot/test/OptimisticOracleV2LLM.ts +++ b/packages/llm-bot/test/OptimisticOracleV2LLM.ts @@ -5,15 +5,7 @@ import { DisputerStrategy, OptimisticOracleClientV2, OptimisticOracleClientV2FilterDisputeable, -<<<<<<< HEAD -<<<<<<< HEAD } from "../src/core/OptimisticOracleV2"; -======= -} from "../src/OptimisticOracleV2"; ->>>>>>> 746ff5a88 (refactor: move llm bots to separate package) -======= -} from "../src/core/OptimisticOracleV2"; ->>>>>>> 99d3cdc95 (refactor: folders) import { defaultOptimisticOracleV2Identifier } from "./constants"; import { optimisticOracleV2Fixture } from "./fixtures/OptimisticOracleV2.Fixture"; import { Signer, hre, toUtf8Bytes } from "./utils";