Skip to content

Commit b2e1971

Browse files
authored
Deprecate AuthChain (#183)
1 parent 30cad09 commit b2e1971

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed

ethproviders/config.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ type NetworkConfig struct {
2424
// Testnet marks the chain as a testnet.
2525
Testnet bool `toml:"testnet" json:"testnet"`
2626

27-
// AuthChain marks the chain as an auth chain.
28-
// Deprecated: no longer required.
29-
AuthChain bool `toml:"auth_chain" json:"authChain"`
30-
3127
// Disabled marks the chain as disabled, and will not be included
3228
// in the list of providers at runtime.
3329
Disabled bool `toml:"disabled" json:"disabled"`
@@ -51,23 +47,3 @@ func (n Config) GetByName(name string) (NetworkConfig, bool) {
5147
}
5248
return NetworkConfig{}, false
5349
}
54-
55-
// Deprecated: no longer required.
56-
func (n Config) AuthChain() (NetworkConfig, bool) {
57-
for _, v := range n {
58-
if v.AuthChain && !v.Testnet {
59-
return v, true
60-
}
61-
}
62-
return NetworkConfig{}, false
63-
}
64-
65-
// Deprecated: no longer required.
66-
func (n Config) TestAuthChain() (NetworkConfig, bool) {
67-
for _, v := range n {
68-
if v.AuthChain && v.Testnet {
69-
return v, true
70-
}
71-
}
72-
return NetworkConfig{}, false
73-
}

ethproviders/ethproviders.go

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ type Providers struct {
2020
testnetChainIDs []uint64
2121
mainnetStringChainIDs []string
2222
testnetStringChainIDs []string
23-
24-
// Deprecated
25-
// TODO: remove in the future
26-
authChain *ethrpc.Provider
27-
testAuthChain *ethrpc.Provider
2823
}
2924

3025
type ChainInfo struct {
@@ -57,16 +52,6 @@ func NewProviders(cfg Config, opts ...ethrpc.Option) (*Providers, error) {
5752
providers.byID[details.ID] = p
5853
providers.byName[name] = p
5954
providers.configByID[details.ID] = details
60-
61-
if (details.AuthChain && !details.Testnet && providers.authChain != nil) || (details.AuthChain && details.Testnet && providers.testAuthChain != nil) {
62-
return nil, fmt.Errorf("duplicate auth chain providers detected in config")
63-
}
64-
if details.AuthChain && !details.Testnet {
65-
providers.authChain = p
66-
}
67-
if details.AuthChain && details.Testnet {
68-
providers.testAuthChain = p
69-
}
7055
}
7156
if len(providers.byID) != len(providers.byName) {
7257
return nil, fmt.Errorf("duplicate provider id or name detected")
@@ -121,38 +106,10 @@ func (p *Providers) GetByChainName(chainName string) *ethrpc.Provider {
121106
return p.byName[chainName]
122107
}
123108

124-
func (p *Providers) GetAuthChain() *ethrpc.Provider {
125-
return p.authChain
126-
}
127-
128-
func (p *Providers) GetTestAuthChain() *ethrpc.Provider {
129-
return p.testAuthChain
130-
}
131-
132-
func (p *Providers) GetAuthProvider() *ethrpc.Provider {
133-
return p.authChain
134-
}
135-
136-
func (p *Providers) GetTestnetAuthProvider() *ethrpc.Provider {
137-
return p.testAuthChain
138-
}
139-
140109
func (p *Providers) ProviderMap() map[uint64]*ethrpc.Provider {
141110
return p.byID
142111
}
143112

144-
func (p *Providers) LookupAuthProviderByChainID(chainID uint64) *ethrpc.Provider {
145-
details, ok := p.configByID[chainID]
146-
if !ok {
147-
return nil
148-
}
149-
if details.Testnet {
150-
return p.testAuthChain
151-
} else {
152-
return p.authChain
153-
}
154-
}
155-
156113
func (p *Providers) ChainList() []ChainInfo {
157114
return p.allChainsList
158115
}

0 commit comments

Comments
 (0)