Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v7): override sdk v47 version check with env variable #1227

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions chain/cosmos/chain_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,21 @@ func (tn *ChainNode) RecoverKey(ctx context.Context, keyName, mnemonic string) e
}

func (tn *ChainNode) IsAboveSDK47(ctx context.Context) bool {
// Check container environment variables for the SDK version.
if tn.Chain.Config().Env != nil {
for _, str := range tn.Chain.Config().Env {
if strings.Contains(str, "ICT_ABOVE_SDK_47") {
return strings.Contains(str, "true")
}
}
}

// Check OS environment variables for the SDK version.
env := os.Getenv("ICT_ABOVE_SDK_47")
if env != "" {
return env == "true"
}

// In SDK v47, a new genesis core command was added. This spec has many state breaking features
// so we use this to switch between new and legacy SDK logic.
// https://github.com/cosmos/cosmos-sdk/pull/14149
Expand Down
7 changes: 6 additions & 1 deletion docs/envOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@

- `CONTAINER_LOG_TAIL`: Specifies the number of lines to display from container logs. Defaults to 50 lines.

- `ICS_SPAWN_TIME_WAIT`: A go duration (e.g. 2m) that specifies how long to wait for ICS chains to spawn
- `ICS_SPAWN_TIME_WAIT`: A go duration (e.g. 2m) that specifies how long to wait for ICS chains to spawn

- `ICT_ABOVE_SDK_47`: (Set via `os.Setenv` or within the IBC Chain Config)

- Set to `"true"` to run tests that require SDK version 0.47.0 or higher.
- Set to `"false"` to run tests that require SDK version 0.46.0 or lower.
Loading