diff --git a/ethproviders/config.go b/ethproviders/config.go index 11ac7423..3737c383 100644 --- a/ethproviders/config.go +++ b/ethproviders/config.go @@ -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"` @@ -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 -} diff --git a/ethproviders/ethproviders.go b/ethproviders/ethproviders.go index cea09d1b..5b6c8390 100644 --- a/ethproviders/ethproviders.go +++ b/ethproviders/ethproviders.go @@ -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 { @@ -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") @@ -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 }