From 39054bb985eba881aa9a7070879c1031fa041b7e Mon Sep 17 00:00:00 2001 From: devmosis Date: Mon, 24 Jul 2023 05:54:17 +0900 Subject: [PATCH 1/3] feat: Improve getSDKVersion function to handle module replacements --- version/version.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index a41834e336c2..f3415a94b4e4 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 { + sdkVersion = dep.Replace.Version + } else { + sdkVersion = dep.Version + } } } From 9dd67b139049138f9d9ea03457d6fa85bc7f08fc Mon Sep 17 00:00:00 2001 From: devmosis Date: Tue, 25 Jul 2023 16:16:29 +0900 Subject: [PATCH 2/3] docs: update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 282343f91e40..101419c36fee 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 From 1a36ec53d07cd776e06f10a7ef601ca7d8234e2b Mon Sep 17 00:00:00 2001 From: devmosis Date: Tue, 25 Jul 2023 17:58:36 +0900 Subject: [PATCH 3/3] fix: hide `(devel)` version Co-authored-by: Julien Robert --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index f3415a94b4e4..502185ad9a0c 100644 --- a/version/version.go +++ b/version/version.go @@ -44,7 +44,7 @@ func getSDKVersion() string { var sdkVersion string for _, dep := range deps.Deps { if dep.Path == "github.com/cosmos/cosmos-sdk" { - if dep.Replace != nil { + if dep.Replace != nil && dep.Replace.Version != "(devel)" { sdkVersion = dep.Replace.Version } else { sdkVersion = dep.Version