File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,25 +26,25 @@ function ethDefaultProvider(network: string | Network): Renetworkable {
2626 if ( options == null ) { options = { } ; }
2727 const providerList : Array < any > = [ ] ;
2828
29- if ( providers . InfuraProvider ) {
29+ if ( providers . InfuraProvider && options . infura !== "-" ) {
3030 try {
3131 providerList . push ( new providers . InfuraProvider ( network , options . infura ) ) ;
3232 } catch ( error ) { }
3333 }
3434
35- if ( providers . EtherscanProvider ) {
35+ if ( providers . EtherscanProvider && options . etherscan !== "-" ) {
3636 try {
3737 providerList . push ( new providers . EtherscanProvider ( network , options . etherscan ) ) ;
3838 } catch ( error ) { }
3939 }
4040
41- if ( providers . AlchemyProvider ) {
41+ if ( providers . AlchemyProvider && options . alchemy !== "-" ) {
4242 try {
4343 providerList . push ( new providers . AlchemyProvider ( network , options . alchemy ) ) ;
4444 } catch ( error ) { }
4545 }
4646
47- if ( providers . PocketProvider ) {
47+ if ( providers . PocketProvider && options . pocket !== "-" ) {
4848 // These networks are currently faulty on Pocket as their
4949 // network does not handle the Berlin hardfork, which is
5050 // live on these ones.
@@ -58,7 +58,7 @@ function ethDefaultProvider(network: string | Network): Renetworkable {
5858 } catch ( error ) { }
5959 }
6060
61- if ( providers . CloudflareProvider ) {
61+ if ( providers . CloudflareProvider && options . cloudflare !== "-" ) {
6262 try {
6363 providerList . push ( new providers . CloudflareProvider ( network ) ) ;
6464 } catch ( error ) { }
You can’t perform that action at this time.
0 commit comments