Skip to content

Commit

Permalink
Default genesis chain name
Browse files Browse the repository at this point in the history
  • Loading branch information
bznein committed Apr 6, 2024
1 parent fe24e23 commit 8434b70
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions e2e/testsuite/testconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,6 @@ func (tc TestConfig) validateGenesisDebugConfig() error {
return nil
}

if cfg.ChainName == "" {
// TODO create a default?
return fmt.Errorf("genesis debug config missing chain name: %+v", cfg)
}

// Verify that the provided chain exists in our config
_, err := tc.GetChainIndex(cfg.ChainName)

Expand Down Expand Up @@ -244,7 +239,7 @@ func (tc TestConfig) GetChainBID() string {
return "chainB-1"
}

// GetChainName returns the naime of the chain given an index.
// GetChainName returns the name of the chain given an index.
func (tc TestConfig) GetChainName(idx int) string {
// Assumes that only valid indices are provided. We do the same in several other places.
chainName := tc.ChainConfigs[idx].Name
Expand All @@ -254,6 +249,16 @@ func (tc TestConfig) GetChainName(idx int) string {
return chainName
}

// GetGenesisChainName returns the name of the chain for which to dump Genesis files.
// If no chain is provided, it uses the default one (chainA).
func (tc TestConfig) GetGenesisChainName() string {
name := tc.DebugConfig.GenesisDebug.ChainName
if name == "" {
return tc.GetChainName(0)
}
return name
}

// UpgradeConfig holds values relevant to upgrade tests.
type UpgradeConfig struct {
PlanName string `yaml:"planName"`
Expand Down

0 comments on commit 8434b70

Please sign in to comment.