Skip to content

Commit

Permalink
Merge pull request #1621 from dappnode/pablo/use-static-method-user-s…
Browse files Browse the repository at this point in the history
…ettings

Use static method to get op node rpc url
  • Loading branch information
pablomendezroyo authored Sep 28, 2023
2 parents df0b494 + 908e8f2 commit eb4d697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
getIsUpdated
} from "../../calls/fetchDnpRequest.js";
import { fileToGatewayUrl } from "../../utils/distributedFile.js";
import { getOptimismNodeRpcUrl } from "./getOptimismNodeRpcUrl.js";
import { getOptimismNodeRpcUrlIfExists } from "./getOptimismNodeRpcUrlIfExists.js";

export async function getOptimismConfig(): Promise<OptimismConfigGet> {
try {
Expand Down Expand Up @@ -61,7 +61,7 @@ export async function getOptimismConfig(): Promise<OptimismConfigGet> {
throw Error(`Repository ${optimismNode} does not exist`);

const pkgData = await getPkgData(releaseFetcher, optimismNode);
const mainnetRpcUrl = getOptimismNodeRpcUrl();
const mainnetRpcUrl = getOptimismNodeRpcUrlIfExists();
const isRunning = getIsRunning(pkgData, dnpList);
resolve({
status: "ok",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { optimismNode } from "@dappnode/types";
import { ComposeFileEditor } from "../compose/editor.js";
import { opNodeRpcUrlEnvName, opNodeServiceName } from "./params.js";

export function getOptimismNodeRpcUrl(): string {
const userSettings = new ComposeFileEditor(
export function getOptimismNodeRpcUrlIfExists(): string {
const userSettings = ComposeFileEditor.getUserSettingsIfExist(
optimismNode,
false
).getUserSettings();
);
return userSettings.environment
? userSettings.environment[opNodeServiceName][opNodeRpcUrlEnvName]
: "";
Expand Down

0 comments on commit eb4d697

Please sign in to comment.