From 40b8c3e0c2cd3d058a7b3fad241408ce55895e00 Mon Sep 17 00:00:00 2001 From: Keyrxng <106303466+Keyrxng@users.noreply.github.com> Date: Tue, 27 Feb 2024 18:09:40 +0000 Subject: [PATCH] chore: no rpc mapping for localhost --- .../rewards/rpc-optimization/get-optimal-provider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/scripts/rewards/rpc-optimization/get-optimal-provider.ts b/static/scripts/rewards/rpc-optimization/get-optimal-provider.ts index b0a0896d..b47a3ede 100644 --- a/static/scripts/rewards/rpc-optimization/get-optimal-provider.ts +++ b/static/scripts/rewards/rpc-optimization/get-optimal-provider.ts @@ -10,6 +10,12 @@ export async function useFastestRpc(app: AppState): Promise { const networkId = app.reward.networkId || app.networkId || app.claims[0].networkId; if (!networkId) throw new Error("Network ID not found"); + if (networkId === 31337) + return new JsonRpcProvider("http://127.0.0.1:8545", { + name: "http://127.0.0.1:8545", + chainId: 31337, + }); + if (!isTestCompleted && !isTestStarted) { isTestStarted = true; await testRpcPerformance(networkId).catch(console.error);