Skip to content

Commit

Permalink
feat: make the repo for the genesis-transform command configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
fastfadingviolets committed Jan 8, 2025
1 parent ed0a63d commit 044434f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
20 changes: 16 additions & 4 deletions chain/cosmos/ics.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,17 @@ func (c *CosmosChain) transformCCVState(ctx context.Context, ccvState []byte, co
if semver.Compare(providerVersion, icsVer400) > 0 {
imageVersion = providerVersion
}
toVersion = semver.Major(consumerVersion)
if toVersion == "v3" {
toVersion = semver.MajorMinor(consumerVersion)
switch semver.Major(consumerVersion) {
case "v4":
if semver.Compare("v4.5.0", consumerVersion) > 0 {
toVersion = "v4.5"
} else {
toVersion = "<v4.5"
}
case "v5":
toVersion = "v5"
case "v6":
toVersion = "<v6.4"
}
} else {
imageVersion = consumerVersion
Expand All @@ -461,8 +469,12 @@ func (c *CosmosChain) transformCCVState(ctx context.Context, ccvState []byte, co
if err != nil {
return nil, fmt.Errorf("failed to write ccv state to file: %w", err)
}
repo := icsCfg.ICSImageRepo
if repo == "" {
repo = "ghcr.io/strangelove-ventures/heighliner/ics"
}
job := dockerutil.NewImage(c.log, c.GetNode().DockerClient, c.GetNode().NetworkID,
c.GetNode().TestName, "ghcr.io/strangelove-ventures/heighliner/ics", imageVersion,
c.GetNode().TestName, repo, imageVersion,
)
cmd := []string{"interchain-security-cd", "genesis", "transform"}
if toVersion != "" {
Expand Down
1 change: 1 addition & 0 deletions ibc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ type ICSConfig struct {
ProviderVerOverride string `yaml:"provider,omitempty" json:"provider,omitempty"`
ConsumerVerOverride string `yaml:"consumer,omitempty" json:"consumer,omitempty"`
ConsumerCopyProviderKey func(int) bool `yaml:"-" json:"-"`
ICSImageRepo string `yaml:"ics-image-repo,omitempty" json:"ics-image-repo,omitempty"`
}

// GenesisConfig is used to start a chain from a pre-defined genesis state.
Expand Down

0 comments on commit 044434f

Please sign in to comment.