This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,7 @@ export interface FetchAndCompileOptions {
124
124
125
125
### ` getSupportedNetworks `
126
126
127
- If you want a list of supported networks, you can call ` getSupportedNetworks ` :
127
+ If you want a (potentially partial) list of supported networks, you can call ` getSupportedNetworks ` :
128
128
129
129
``` ts
130
130
import { getSupportedNetworks } from " @truffle/fetch-and-compile" ;
@@ -140,6 +140,8 @@ const networks = getSupportedNetworks();
140
140
// }
141
141
```
142
142
143
+ Note that there may be additional unlisted supported networks.
144
+
143
145
You can also pass in a list of fetchers if you want to restrict the output to the networks
144
146
supported by the fetchers you list. (You can also pass in a config and it will use the ` sourceFetchers `
145
147
property if set, or a ` FetchAndCompileOptions ` and it will use the ` fetch.precedence ` field if set.)
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ const debug = debugModule("source-fetcher:sourcify");
3
3
4
4
import type { Fetcher , FetcherConstructor } from "./types" ;
5
5
import type * as Types from "./types" ;
6
- import { removeLibraries , InvalidNetworkError } from "./common" ;
6
+ import { removeLibraries } from "./common" ;
7
7
import { networkNamesById , networksByName } from "./networks" ;
8
8
import retry from "async-retry" ;
9
9
@@ -164,12 +164,8 @@ const SourcifyFetcher: FetcherConstructor = class SourcifyFetcher
164
164
constructor ( networkId : number ) {
165
165
this . networkId = networkId ;
166
166
this . networkName = networkNamesById [ networkId ] ;
167
- if (
168
- this . networkName === undefined ||
169
- ! SourcifyFetcher . supportedNetworks . has ( this . networkName )
170
- ) {
171
- throw new InvalidNetworkError ( networkId , "sourcify" ) ;
172
- }
167
+ //we no longer check if the network is supported; the list is now only
168
+ //used for if you explicitly ask
173
169
}
174
170
175
171
static getSupportedNetworks ( ) : Types . SupportedNetworks {
You can’t perform that action at this time.
0 commit comments