Skip to content

Commit af0fdcc

Browse files
author
Bernd Mueller
committed
Added cli option to enable genesis-transformation: disabled by default
1 parent c359fdb commit af0fdcc

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

tests/e2e/actions.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ func (tr TestRun) startConsumerChain(
575575
log.Fatal(err, "\n", string(bz))
576576
}
577577

578-
if tr.consumerVersion != "" {
578+
// only needed when consumer is running v3.2.x and later
579+
if tr.transformGenesis {
579580
log.Printf("@@@@ Transforming consumer genesis for a newer version: %s\n", tr.consumerVersion)
580581
log.Printf("Original ccv genesis: %s\n", string(bz))
581582

tests/e2e/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,10 @@ type TestRun struct {
7878
gaiaTag string
7979

8080
// consumer version the provider should be tested against
81-
consumerVersion string
82-
providerVersion string
83-
name string
81+
consumerVersion string
82+
providerVersion string
83+
transformGenesis bool
84+
name string
8485
}
8586

8687
func getDefaultValidators() map[validatorID]ValidatorConfig {

tests/e2e/main.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ var (
4040
var (
4141
useConsumerVersion = flag.String("consumer-version", "", "ICS tag to specify the consumer version to test the provider against")
4242
useProviderVersion = flag.String("provider-version", "", "ICS tag to specify the provider version to test the consumer against")
43+
transformGenesis = flag.Bool("transform-genesis", false, "do consumer genesis transformation for newer clients. Needed when provider chain is on an older version")
4344
)
4445

4546
// runs E2E tests
@@ -51,14 +52,14 @@ func main() {
5152
if shortHappyPathOnly != nil && *shortHappyPathOnly {
5253
fmt.Println("=============== running short happy path only ===============")
5354
tr := DefaultTestRun()
54-
tr.Run(shortHappyPathSteps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion)
55+
tr.Run(shortHappyPathSteps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion, *transformGenesis)
5556
return
5657
}
5758

5859
if happyPathOnly != nil && *happyPathOnly {
5960
fmt.Println("=============== running happy path only ===============")
6061
tr := DefaultTestRun()
61-
tr.Run(happyPathSteps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion)
62+
tr.Run(happyPathSteps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion, *transformGenesis)
6263
return
6364
}
6465

@@ -82,7 +83,7 @@ func main() {
8283
go func(run testRunWithSteps) {
8384
defer wg.Done()
8485
tr := run.testRun
85-
tr.Run(run.steps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion)
86+
tr.Run(run.steps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion, *transformGenesis)
8687
}(run)
8788
}
8889
wg.Wait()
@@ -92,18 +93,21 @@ func main() {
9293

9394
for _, run := range testRuns {
9495
tr := run.testRun
95-
tr.Run(run.steps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion)
96+
tr.Run(run.steps, *localSdkPath, *useGaia, *gaiaTag, *useConsumerVersion, *useProviderVersion, *transformGenesis)
9697
}
9798
fmt.Printf("TOTAL TIME ELAPSED: %v\n", time.Since(start))
9899
}
99100

100101
// Run sets up docker container and executes the steps in the test run.
101102
// Docker containers are torn down after the test run is complete.
102-
func (tr *TestRun) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string, consumerVersion string, providerVersion string) {
103+
func (tr *TestRun) Run(steps []Step, localSdkPath string, useGaia bool, gaiaTag string, consumerVersion string, providerVersion string, transformGenesis bool) {
103104
tr.SetDockerConfig(localSdkPath, useGaia, gaiaTag, consumerVersion, providerVersion)
104105
tr.SetCometMockConfig(*useCometmock)
105106
tr.SetRelayerConfig(*useGorelayer)
106107

108+
// Hack to disable genesis transformation... do it smarter
109+
tr.transformGenesis = transformGenesis
110+
107111
tr.validateStringLiterals()
108112
tr.startDocker()
109113
tr.executeSteps(steps)

0 commit comments

Comments
 (0)