From ced06ae21731d61404213bd0048c8adb101fabda Mon Sep 17 00:00:00 2001 From: Amadeo Pellicce Date: Sun, 5 Feb 2023 16:56:05 -0800 Subject: [PATCH] adding dir parameter to function --- src/db/asset.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/db/asset.ts b/src/db/asset.ts index 9a4376e..33f1884 100644 --- a/src/db/asset.ts +++ b/src/db/asset.ts @@ -1,6 +1,7 @@ import { Asset } from "../model"; import { AssetMapping } from "../model/AssetMapping"; import { getAssetMapping, getAssetsForNetwork, getNetworks } from "../networks"; +import { DEFAULT_REPO_DISK_LOCATION } from "../utils/constants"; import { ETHEREUM_ASSETS, POLYGON_ASSETS } from "./assets.json"; type AssetInfoCallback = (assetInfo: Asset) => Promise; @@ -70,7 +71,7 @@ async function getMockAssets(networkId?: string): Promise { return res as Asset[]; } -export async function getAssetsByNetworkCodeAndSymbol(networkCode: string, symbol: string): Promise { - const assets = await getAssetsForNetwork(networkCode); +export async function getAssetsByNetworkCodeAndSymbol(networkCode: string, symbol: string, dir = DEFAULT_REPO_DISK_LOCATION): Promise { + const assets = await getAssetsForNetwork(networkCode, dir); return assets.filter((asset) => asset.symbol === symbol); }