Skip to content

Commit

Permalink
feat: Improve getSDKVersion() to handle module replacements (#17096)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <[email protected]>
  • Loading branch information
Ryz0nd and julienrbrt authored Jul 25, 2023
1 parent c74e288 commit b0acf60
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 @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (x/group, x/gov) [#17109](https://github.com/cosmos/cosmos-sdk/pull/17109) Let proposal summary be 40x longer than metadata limit.
* (all) [#16537](https://github.com/cosmos/cosmos-sdk/pull/16537) Properly propagated `fmt.Errorf` errors and using `errors.New` where appropriate.
* (version) [#17096](https://github.com/cosmos/cosmos-sdk/pull/17096) Improve `getSDKVersion()` to handle module replacements

### Bug Fixes

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 b0acf60

Please sign in to comment.