Skip to content

Commit

Permalink
Use new NetworkConfig.Disabled in constructor (#101)
Browse files Browse the repository at this point in the history
* Use new NetworkConfig.Disabled in constructor

* Use new NetworkConfig.Disabled in constructor 2
  • Loading branch information
marino39 authored Aug 15, 2023
1 parent 96efaf7 commit 1541dc7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ethproviders/ethproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func NewProviders(cfg Config) (*Providers, error) {
}

for name, details := range cfg {
if details.Disabled {
continue
}

p, err := ethrpc.NewProvider(details.URL)
if err != nil {
return nil, err
Expand Down Expand Up @@ -59,6 +63,10 @@ func NewProviders(cfg Config) (*Providers, error) {
// build the chain list object
chainList := []ChainInfo{}
for name, networkConfig := range cfg {
if networkConfig.Disabled {
continue
}

chainList = append(chainList, ChainInfo{ID: networkConfig.ID, Name: name})
}
sort.SliceStable(chainList, func(i, j int) bool {
Expand Down

0 comments on commit 1541dc7

Please sign in to comment.