diff --git a/cypress/scripts/anvil.ts b/cypress/scripts/anvil.ts index efbb52b7..ffb21fe5 100644 --- a/cypress/scripts/anvil.ts +++ b/cypress/scripts/anvil.ts @@ -1,14 +1,13 @@ +import { RPCHandler } from "@ubiquity-dao/rpc-handler"; import { spawnSync } from "child_process"; import { useHandler } from "../../static/scripts/rewards/web3/use-rpc-handler"; -// @ts-expect-error - Missing types -import { RPCHandler } from "@ubiquity-dao/rpc-handler"; class Anvil { rpcs: string[] = []; rpcHandler: RPCHandler | null = null; async init() { - this.rpcHandler = await useHandler(100); + this.rpcHandler = useHandler(100); console.log(`[RPCHandler] Fetching RPCs...`); await this.rpcHandler.testRpcPerformance(); const latencies: Record = this.rpcHandler.getLatencies(); diff --git a/static/scripts/rewards/web3/use-rpc-handler.ts b/static/scripts/rewards/web3/use-rpc-handler.ts index 97d3c2fe..8715cfb9 100644 --- a/static/scripts/rewards/web3/use-rpc-handler.ts +++ b/static/scripts/rewards/web3/use-rpc-handler.ts @@ -22,7 +22,7 @@ export async function useRpcHandler(app: AppState) { throw new Error("Network ID not set"); } - const handler = await useHandler(networkId); + const handler = useHandler(networkId); const provider = await handler.getFastestRpcProvider(); const url = provider.connection.url; if (!url) {