Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Config and NetworkResources #16

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions config/iconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ type IConfig interface {
// The path to use for the wallet keystore's password file
GetPasswordFilePath() string

// The resources for the selected network
GetNetworkResources() *NetworkResources

// The URLs for the Execution clients to use
GetExecutionClientUrls() (string, string)

Expand Down
26 changes: 1 addition & 25 deletions node/services/service-provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,6 @@ type IBeaconClientProvider interface {
GetBeaconClient() *BeaconClientManager
}

// Provides access to the node's configuration and list of resources for the current network
type IConfigProvider interface {
// Gets the node's configuration
GetConfig() config.IConfig

// Gets the network resources for the current network
GetNetworkResources() *config.NetworkResources
}

// Provides access to a Docker client
type IDockerProvider interface {
// Gets the Docker client
Expand Down Expand Up @@ -86,7 +77,6 @@ type IContextProvider interface {
type IServiceProvider interface {
IEthClientProvider
IBeaconClientProvider
IConfigProvider
IDockerProvider
ILoggerProvider
IWalletProvider
Expand All @@ -101,8 +91,6 @@ type IServiceProvider interface {
// A container for all of the various services used by the node service
type serviceProvider struct {
// Services
cfg config.IConfig
resources *config.NetworkResources
nodeWallet *wallet.Wallet
ecManager *ExecutionClientManager
bcManager *BeaconClientManager
Expand All @@ -120,9 +108,7 @@ type serviceProvider struct {
}

// Creates a new ServiceProvider instance based on the given config
func NewServiceProvider(cfg config.IConfig, clientTimeout time.Duration) (IServiceProvider, error) {
resources := cfg.GetNetworkResources()

func NewServiceProvider(cfg config.IConfig, resources *config.NetworkResources, clientTimeout time.Duration) (IServiceProvider, error) {
// EC Manager
var ecManager *ExecutionClientManager
primaryEcUrl, fallbackEcUrl := cfg.GetExecutionClientUrls()
Expand Down Expand Up @@ -207,8 +193,6 @@ func NewServiceProviderWithCustomServices(cfg config.IConfig, resources *config.

// Create the provider
provider := &serviceProvider{
cfg: cfg,
resources: resources,
nodeWallet: nodeWallet,
ecManager: ecManager,
bcManager: bcManager,
Expand All @@ -234,14 +218,6 @@ func (p *serviceProvider) Close() error {
// === Getters ===
// ===============

func (p *serviceProvider) GetConfig() config.IConfig {
return p.cfg
}

func (p *serviceProvider) GetNetworkResources() *config.NetworkResources {
return p.resources
}

func (p *serviceProvider) GetWallet() *wallet.Wallet {
return p.nodeWallet
}
Expand Down
Loading