Skip to content

Commit a5944f5

Browse files
committed
fix: workaround graphql-request ESM import in keeper-bot
1 parent eabb03b commit a5944f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contracts/scripts/keeperBot.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import {
99
DisputeKitClassic,
1010
ChainlinkRNG,
1111
} from "../typechain-types";
12-
import request from "graphql-request";
1312
import env from "./utils/env";
1413
import loggerFactory from "./utils/logger";
1514
import { toBigInt, BigNumberish, getNumber } from "ethers";
1615
import hre = require("hardhat");
1716

17+
let request: <T>(url: string, query: string) => Promise<T>; // Workaround graphql-request ESM import
1818
const { ethers } = hre;
1919
const MAX_DRAW_ITERATIONS = 30;
2020
const MAX_EXECUTE_ITERATIONS = 20;
@@ -478,6 +478,8 @@ const sendHeartbeat = async () => {
478478
};
479479

480480
async function main() {
481+
const graphqlRequest = await import("graphql-request"); // Workaround graphql-request ESM import
482+
request = graphqlRequest.request;
481483
const { core, sortition, disputeKitClassic } = await getContracts();
482484

483485
const getBlockTime = async () => {

0 commit comments

Comments
 (0)