Skip to content

Commit

Permalink
fix: state file dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Mani Brar authored and Mani Brar committed Jan 27, 2025
1 parent 4da75bf commit 1609300
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion relayer-cli/src/utils/relayerHelpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe("relayerHelpers", () => {
describe("updateStateFile", () => {
it("should write a state file with the provided nonce", async () => {
const createdTimestamp = 123456;
const fileDirectory = "./state/testing_1.json";
const fileDirectory = process.env.STATE_DIR + network + "_" + chainId + ".json";
await updateStateFile(chainId, createdTimestamp, 10, network, emitter as any, fileSystem as any, releaseLock);
expect(fileSystem.writeFileSync).toHaveBeenCalledWith(
fileDirectory,
Expand Down
2 changes: 2 additions & 0 deletions relayer-cli/src/utils/relayerHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { EventEmitter } from "events";
import { claimLock, releaseLock } from "./lock";
import ShutdownManager from "./shutdownManager";
import { BotEvents } from "./botEvents";
require("dotenv").config();

/**
* Initialize the relayer by claiming the lock and reading the nonce from the state file.
Expand Down Expand Up @@ -51,6 +52,7 @@ async function updateStateFile(
fileSystem: typeof fs = fs,
removeLock: typeof releaseLock = releaseLock
) {
console.log(process.env.STATE_DIR);
const chain_state_file = process.env.STATE_DIR + network + "_" + chainId + ".json";
const json = {
ts: createdTimestamp,
Expand Down

0 comments on commit 1609300

Please sign in to comment.