From f1075a55d8b0a45f3c5c9f2ee97dd7711a596ba3 Mon Sep 17 00:00:00 2001 From: Joe Clapis Date: Thu, 11 Jul 2024 16:03:35 -0400 Subject: [PATCH] Removed Config and NetworkResources getters in prep for loading resources from disk --- config/iconfig.go | 3 --- node/services/service-provider.go | 26 +------------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/config/iconfig.go b/config/iconfig.go index 8e659dc..ad1492b 100644 --- a/config/iconfig.go +++ b/config/iconfig.go @@ -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) diff --git a/node/services/service-provider.go b/node/services/service-provider.go index e2742bb..6712395 100644 --- a/node/services/service-provider.go +++ b/node/services/service-provider.go @@ -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 @@ -86,7 +77,6 @@ type IContextProvider interface { type IServiceProvider interface { IEthClientProvider IBeaconClientProvider - IConfigProvider IDockerProvider ILoggerProvider IWalletProvider @@ -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 @@ -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() @@ -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, @@ -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 }