Skip to content

Commit 20f9dcd

Browse files
authored
[tmpnet] s/Network.ChainConfigs/Network.PrimaryChainConfigs/ (#3854)
1 parent 937eddc commit 20f9dcd

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

tests/fixture/tmpnet/network.go

+6-7
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ type Network struct {
102102
Genesis *genesis.UnparsedConfig
103103

104104
// Configuration for primary network chains (P, X, C)
105-
// TODO(marun) Rename to PrimaryChainConfigs
106-
ChainConfigs map[string]FlagsMap
105+
PrimaryChainConfigs map[string]FlagsMap
107106

108107
// Default configuration to use when creating new nodes
109108
DefaultFlags FlagsMap
@@ -236,15 +235,15 @@ func (n *Network) EnsureDefaultConfig(log logging.Logger, avalancheGoPath string
236235
}
237236

238237
// Ensure primary chains are configured
239-
if n.ChainConfigs == nil {
240-
n.ChainConfigs = map[string]FlagsMap{}
238+
if n.PrimaryChainConfigs == nil {
239+
n.PrimaryChainConfigs = map[string]FlagsMap{}
241240
}
242241
defaultChainConfigs := DefaultChainConfigs()
243242
for alias, chainConfig := range defaultChainConfigs {
244-
if _, ok := n.ChainConfigs[alias]; !ok {
245-
n.ChainConfigs[alias] = FlagsMap{}
243+
if _, ok := n.PrimaryChainConfigs[alias]; !ok {
244+
n.PrimaryChainConfigs[alias] = FlagsMap{}
246245
}
247-
n.ChainConfigs[alias].SetDefaults(chainConfig)
246+
n.PrimaryChainConfigs[alias].SetDefaults(chainConfig)
248247
}
249248

250249
// Ensure runtime is configured

tests/fixture/tmpnet/network_config.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (n *Network) readChainConfigs() error {
123123

124124
// Clear the map of data that may end up stale (e.g. if a given
125125
// chain is in the map but no longer exists on disk)
126-
n.ChainConfigs = map[string]FlagsMap{}
126+
n.PrimaryChainConfigs = map[string]FlagsMap{}
127127

128128
for _, entry := range entries {
129129
if !entry.IsDir() {
@@ -141,7 +141,7 @@ func (n *Network) readChainConfigs() error {
141141
if err != nil {
142142
return err
143143
}
144-
n.ChainConfigs[chainAlias] = chainConfig
144+
n.PrimaryChainConfigs[chainAlias] = chainConfig
145145
}
146146

147147
return nil
@@ -150,7 +150,7 @@ func (n *Network) readChainConfigs() error {
150150
func (n *Network) writeChainConfigs() error {
151151
baseChainConfigDir := n.GetChainConfigDir()
152152

153-
for chainAlias, chainConfig := range n.ChainConfigs {
153+
for chainAlias, chainConfig := range n.PrimaryChainConfigs {
154154
// Create the directory
155155
chainConfigDir := filepath.Join(baseChainConfigDir, chainAlias)
156156
if err := os.MkdirAll(chainConfigDir, perms.ReadWriteExecute); err != nil {

0 commit comments

Comments
 (0)