diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index ee9996e7a0..b24ed27ee2 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -582,10 +582,9 @@ func (tr *TestConfig) startConsumerChain( log.Fatal(err, "\n", string(bz)) } - // Hack to deal with deprecated consumer genesis exports - // TODO: needs better case identification - if tr.consumerVersion != "" { - log.Printf("Transforming consumer genesis for a newer version: %s\n", tr.consumerVersion) + // only needed when consumer is running v3.2.x and later + if tr.transformGenesis { + log.Printf("@@@@ Transforming consumer genesis for a newer version: %s\n", tr.consumerVersion) log.Printf("Original ccv genesis: %s\n", string(bz)) file, err := os.Create("consumer_genesis.json") diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 9de962c57f..0855158c37 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -82,9 +82,10 @@ type TestConfig struct { timeOffset time.Duration // consumer version the provider should be tested against - consumerVersion string - providerVersion string - name string + consumerVersion string + providerVersion string + transformGenesis bool + name string } // Initialize initializes the TestConfig instance by setting the runningChains field to an empty map. diff --git a/tests/e2e/main.go b/tests/e2e/main.go index 9a16e9e481..178798d279 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -52,6 +52,7 @@ var ( var ( useConsumerVersion = flag.String("consumer-version", "", "ICS tag to specify the consumer version to test the provider against") useProviderVersion = flag.String("provider-version", "", "ICS tag to specify the provider version to test the consumer against") + transformGenesis = flag.Bool("transform-genesis", false, "do consumer genesis transformation for newer clients. Needed when provider chain is on an older version") ) var ( @@ -285,7 +286,7 @@ func main() { if err := parseArguments(); err != nil { flag.Usage() log.Fatalf("Error parsing command arguments %s\n", err) - } + } if *useConsumerVersion != "" && *useProviderVersion != "" { log.Fatalf("consumer-version & provider-version specified! Note: for compatibility tests current checked out version can only be tested against a different provider or consumer version") @@ -302,11 +303,14 @@ func main() { // Run sets up docker container and executes the steps in the test run. // Docker containers are torn down after the test run is complete. -func (tr *TestConfig) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string, consumerVersion string, providerVersion string) { +func (tr *TestConfig) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string, consumerVersion string, providerVersion string, transformGenesis bool) { tr.SetDockerConfig(localSdkPath, useGaia, gaiaTag, consumerVersion, providerVersion) tr.SetCometMockConfig(*useCometmock) tr.SetRelayerConfig(*useGorelayer) + // Hack to disable genesis transformation... do it smarter + tr.transformGenesis = transformGenesis + tr.validateStringLiterals() tr.startDocker() tr.executeSteps(steps)