diff --git a/CHANGELOG.md b/CHANGELOG.md index cfba0b2b0ffe..5bb7d2a4751c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/version/version.go b/version/version.go index a41834e336c2..502185ad9a0c 100644 --- a/version/version.go +++ b/version/version.go @@ -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 + } } }