Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions ethproviders/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ type NetworkConfig struct {
// Testnet marks the chain as a testnet.
Testnet bool `toml:"testnet" json:"testnet"`

// AuthChain marks the chain as an auth chain.
// Deprecated: no longer required.
AuthChain bool `toml:"auth_chain" json:"authChain"`

// Disabled marks the chain as disabled, and will not be included
// in the list of providers at runtime.
Disabled bool `toml:"disabled" json:"disabled"`
Expand All @@ -51,23 +47,3 @@ func (n Config) GetByName(name string) (NetworkConfig, bool) {
}
return NetworkConfig{}, false
}

// Deprecated: no longer required.
func (n Config) AuthChain() (NetworkConfig, bool) {
for _, v := range n {
if v.AuthChain && !v.Testnet {
return v, true
}
}
return NetworkConfig{}, false
}

// Deprecated: no longer required.
func (n Config) TestAuthChain() (NetworkConfig, bool) {
for _, v := range n {
if v.AuthChain && v.Testnet {
return v, true
}
}
return NetworkConfig{}, false
}
43 changes: 0 additions & 43 deletions ethproviders/ethproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ type Providers struct {
testnetChainIDs []uint64
mainnetStringChainIDs []string
testnetStringChainIDs []string

// Deprecated
// TODO: remove in the future
authChain *ethrpc.Provider
testAuthChain *ethrpc.Provider
}

type ChainInfo struct {
Expand Down Expand Up @@ -57,16 +52,6 @@ func NewProviders(cfg Config, opts ...ethrpc.Option) (*Providers, error) {
providers.byID[details.ID] = p
providers.byName[name] = p
providers.configByID[details.ID] = details

if (details.AuthChain && !details.Testnet && providers.authChain != nil) || (details.AuthChain && details.Testnet && providers.testAuthChain != nil) {
return nil, fmt.Errorf("duplicate auth chain providers detected in config")
}
if details.AuthChain && !details.Testnet {
providers.authChain = p
}
if details.AuthChain && details.Testnet {
providers.testAuthChain = p
}
}
if len(providers.byID) != len(providers.byName) {
return nil, fmt.Errorf("duplicate provider id or name detected")
Expand Down Expand Up @@ -121,38 +106,10 @@ func (p *Providers) GetByChainName(chainName string) *ethrpc.Provider {
return p.byName[chainName]
}

func (p *Providers) GetAuthChain() *ethrpc.Provider {
return p.authChain
}

func (p *Providers) GetTestAuthChain() *ethrpc.Provider {
return p.testAuthChain
}

func (p *Providers) GetAuthProvider() *ethrpc.Provider {
return p.authChain
}

func (p *Providers) GetTestnetAuthProvider() *ethrpc.Provider {
return p.testAuthChain
}

func (p *Providers) ProviderMap() map[uint64]*ethrpc.Provider {
return p.byID
}

func (p *Providers) LookupAuthProviderByChainID(chainID uint64) *ethrpc.Provider {
details, ok := p.configByID[chainID]
if !ok {
return nil
}
if details.Testnet {
return p.testAuthChain
} else {
return p.authChain
}
}

func (p *Providers) ChainList() []ChainInfo {
return p.allChainsList
}
Expand Down
Loading