From 24c02ee59d757154dd301830433598fcbe64d148 Mon Sep 17 00:00:00 2001 From: lukaszcl <120112546+lukaszcl@users.noreply.github.com> Date: Fri, 30 Aug 2024 15:12:19 +0200 Subject: [PATCH] Fix lint --- config/network.go | 92 --------------------------------------- k8s/environment/runner.go | 1 - 2 files changed, 93 deletions(-) diff --git a/config/network.go b/config/network.go index b5fce4c09..4ea150062 100644 --- a/config/network.go +++ b/config/network.go @@ -5,8 +5,6 @@ import ( "fmt" "strings" - "github.com/pelletier/go-toml/v2" - "github.com/smartcontractkit/chainlink-testing-framework/blockchain" "github.com/smartcontractkit/chainlink-testing-framework/logging" ) @@ -84,28 +82,6 @@ func (n NetworkConfig) IsSimulatedGethSelected() bool { return false } -func (n *NetworkConfig) applyDecoded(configDecoded string) error { - if configDecoded == "" { - return nil - } - - var cfg NetworkConfig - err := toml.Unmarshal([]byte(configDecoded), &cfg) - if err != nil { - return fmt.Errorf("error unmarshalling network config: %w", err) - } - - cfg.UpperCaseNetworkNames() - - err = n.applyDefaults(&cfg) - if err != nil { - return fmt.Errorf("error applying overrides from decoded network config file to config: %w", err) - } - n.OverrideURLsAndKeysFromEVMNetwork() - - return nil -} - // OverrideURLsAndKeysFromEVMNetwork applies the URLs and keys from the EVMNetworks to the NetworkConfig // it overrides the URLs and Keys present in RpcHttpUrls, RpcWsUrls and WalletKeys in the NetworkConfig // with the URLs and Keys provided in the EVMNetworks @@ -218,71 +194,3 @@ func (n *NetworkConfig) UpperCaseNetworkNames() { n.SelectedNetworks[i] = strings.ToUpper(network) } } - -func (n *NetworkConfig) applyDefaults(defaults *NetworkConfig) error { - if defaults == nil { - return nil - } - - if defaults.SelectedNetworks != nil { - n.SelectedNetworks = defaults.SelectedNetworks - } - if defaults.EVMNetworks != nil { - if n.EVMNetworks == nil || len(n.EVMNetworks) == 0 { - n.EVMNetworks = defaults.EVMNetworks - } else { - for network, cfg := range defaults.EVMNetworks { - if _, ok := n.EVMNetworks[network]; !ok { - n.EVMNetworks[network] = cfg - } - } - } - } - if defaults.AnvilConfigs != nil { - if n.AnvilConfigs == nil || len(n.AnvilConfigs) == 0 { - n.AnvilConfigs = defaults.AnvilConfigs - } else { - for network, cfg := range defaults.AnvilConfigs { - if _, ok := n.AnvilConfigs[network]; !ok { - n.AnvilConfigs[network] = cfg - } - } - } - } - if defaults.RpcHttpUrls != nil { - if n.RpcHttpUrls == nil || len(n.RpcHttpUrls) == 0 { - n.RpcHttpUrls = defaults.RpcHttpUrls - } else { - for network, urls := range defaults.RpcHttpUrls { - if _, ok := n.RpcHttpUrls[network]; !ok { - n.RpcHttpUrls[network] = urls - } - } - } - } - if defaults.RpcWsUrls != nil { - if n.RpcWsUrls == nil || len(n.RpcWsUrls) == 0 { - n.RpcWsUrls = defaults.RpcWsUrls - } else { - for network, urls := range defaults.RpcWsUrls { - if _, ok := n.RpcWsUrls[network]; !ok { - n.RpcWsUrls[network] = urls - } - } - } - } - if defaults.WalletKeys != nil { - if n.WalletKeys == nil || len(n.WalletKeys) == 0 { - n.WalletKeys = defaults.WalletKeys - } else { - - for network, keys := range defaults.WalletKeys { - if _, ok := n.WalletKeys[network]; !ok { - n.WalletKeys[network] = keys - } - } - } - } - - return nil -} diff --git a/k8s/environment/runner.go b/k8s/environment/runner.go index 90b7276b9..b15840b26 100644 --- a/k8s/environment/runner.go +++ b/k8s/environment/runner.go @@ -399,7 +399,6 @@ func jobEnvVars(props *Props) *[]*k8s.EnvVar { config.EnvVarInternalDockerRepo, config.EnvVarLocalCharts, config.EnvBase64ConfigOverride, - config.EnvBase64NetworkConfig, } for _, k := range lookups { v, success := os.LookupEnv(k)