Skip to content

Commit

Permalink
adding dir parameter to function
Browse files Browse the repository at this point in the history
  • Loading branch information
pellicceama committed Feb 6, 2023
1 parent 6912b07 commit ced06ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/db/asset.ts
Original file line number Diff line number Diff line change
@@ -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<void>;
Expand Down Expand Up @@ -70,7 +71,7 @@ async function getMockAssets(networkId?: string): Promise<Asset[]> {
return res as Asset[];
}

export async function getAssetsByNetworkCodeAndSymbol(networkCode: string, symbol: string): Promise<Asset[]> {
const assets = await getAssetsForNetwork(networkCode);
export async function getAssetsByNetworkCodeAndSymbol(networkCode: string, symbol: string, dir = DEFAULT_REPO_DISK_LOCATION): Promise<Asset[]> {
const assets = await getAssetsForNetwork(networkCode, dir);
return assets.filter((asset) => asset.symbol === symbol);
}

0 comments on commit ced06ae

Please sign in to comment.