Skip to content

Commit

Permalink
feat: Improve getSDKVersion() to handle module replacements (backport
Browse files Browse the repository at this point in the history
#17096) (#17125)

Co-authored-by: devmosis <ryzond6728@gmail.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people committed Jul 25, 2023
1 parent 0cff9ce commit d234c6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

* (x/group, x/gov) [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Let proposal summary be 40x longer than metadata limit.
* (version) [#17096](https://github.com/cosmos/cosmos-sdk/pull/17096) Improve `getSDKVersion()` to handle module replacements.

### CLI Breaking Changes

Expand Down
6 changes: 5 additions & 1 deletion version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ func getSDKVersion() string {
var sdkVersion string
for _, dep := range deps.Deps {
if dep.Path == "github.com/cosmos/cosmos-sdk" {
sdkVersion = dep.Version
if dep.Replace != nil && dep.Replace.Version != "(devel)" {
sdkVersion = dep.Replace.Version
} else {
sdkVersion = dep.Version
}
}
}

Expand Down

0 comments on commit d234c6a

Please sign in to comment.