diff --git a/packages/fetch-and-compile/README.md b/packages/fetch-and-compile/README.md index be0ff07f045..cc07f00e7b2 100644 --- a/packages/fetch-and-compile/README.md +++ b/packages/fetch-and-compile/README.md @@ -124,7 +124,7 @@ export interface FetchAndCompileOptions { ### `getSupportedNetworks` -If you want a list of supported networks, you can call `getSupportedNetworks`: +If you want a (potentially partial) list of supported networks, you can call `getSupportedNetworks`: ```ts import { getSupportedNetworks } from "@truffle/fetch-and-compile"; @@ -140,6 +140,8 @@ const networks = getSupportedNetworks(); // } ``` +Note that there may be additional unlisted supported networks. + You can also pass in a list of fetchers if you want to restrict the output to the networks supported by the fetchers you list. (You can also pass in a config and it will use the `sourceFetchers` property if set, or a `FetchAndCompileOptions` and it will use the `fetch.precedence` field if set.) diff --git a/packages/source-fetcher/lib/sourcify.ts b/packages/source-fetcher/lib/sourcify.ts index 99f2a23833c..90fbe4c4950 100644 --- a/packages/source-fetcher/lib/sourcify.ts +++ b/packages/source-fetcher/lib/sourcify.ts @@ -3,7 +3,7 @@ const debug = debugModule("source-fetcher:sourcify"); import type { Fetcher, FetcherConstructor } from "./types"; import type * as Types from "./types"; -import { removeLibraries, InvalidNetworkError } from "./common"; +import { removeLibraries } from "./common"; import { networkNamesById, networksByName } from "./networks"; import retry from "async-retry"; @@ -164,12 +164,8 @@ const SourcifyFetcher: FetcherConstructor = class SourcifyFetcher constructor(networkId: number) { this.networkId = networkId; this.networkName = networkNamesById[networkId]; - if ( - this.networkName === undefined || - !SourcifyFetcher.supportedNetworks.has(this.networkName) - ) { - throw new InvalidNetworkError(networkId, "sourcify"); - } + //we no longer check if the network is supported; the list is now only + //used for if you explicitly ask } static getSupportedNetworks(): Types.SupportedNetworks {