diff --git a/ignite/pkg/cosmosbuf/buf.go b/ignite/pkg/cosmosbuf/buf.go index 5a747238c6..709a7bd2ca 100644 --- a/ignite/pkg/cosmosbuf/buf.go +++ b/ignite/pkg/cosmosbuf/buf.go @@ -96,7 +96,7 @@ func (b Buf) Update(ctx context.Context, modDir string, dependencies ...string) // Export runs the buf Export command for the files in the proto directory. func (b Buf) Export(ctx context.Context, protoDir, output string) error { // Check if the proto directory is the Cosmos SDK one - if strings.HasSuffix(protoDir, cosmosver.CosmosSDK) { + if strings.Contains(protoDir, cosmosver.CosmosModulePath) { if b.sdkProtoDir == "" { // Copy Cosmos SDK proto path without the Buf workspace. // This is done because the workspace contains a reference to @@ -164,7 +164,7 @@ func (b Buf) Generate( // can't download this folder because is unused as a dependency. We need to // change the workspace copying the files to another folder and generate the // files. - if strings.HasSuffix(protoDir, cosmosver.CosmosSDK) { + if strings.Contains(protoDir, cosmosver.CosmosModulePath) { if b.sdkProtoDir == "" { b.sdkProtoDir, err = copySDKProtoDir(protoDir) if err != nil { diff --git a/ignite/pkg/cosmosver/detect.go b/ignite/pkg/cosmosver/detect.go index 943a22de77..dab7d36eb6 100644 --- a/ignite/pkg/cosmosver/detect.go +++ b/ignite/pkg/cosmosver/detect.go @@ -9,8 +9,6 @@ import ( var ( // CosmosModulePath defines Cosmos SDK import path. CosmosModulePath = "github.com/cosmos/cosmos-sdk" - // CosmosSDK defines Cosmos SDK repository name. - CosmosSDK = "cosmos-sdk" // CosmosSDKModulePathPattern defines a regexp pattern for Cosmos SDK import path. CosmosSDKModulePathPattern = regexp.MustCompile(`github\.com\/[^\/]+\/cosmos-sdk`) ) diff --git a/ignite/version/version.go b/ignite/version/version.go index 853711b722..28955a3ab7 100644 --- a/ignite/version/version.go +++ b/ignite/version/version.go @@ -190,7 +190,7 @@ func Long(ctx context.Context) string { // AssertSupportedCosmosSDKVersion asserts that a Cosmos SDK version is supported by Ignite CLI. func AssertSupportedCosmosSDKVersion(v cosmosver.Version) error { if v.LT(cosmosver.StargateFortySevenTwoVersion) { - return fmt.Errorf(errOldCosmosSDKVersionStr, v) //nolint:staticcheck // this gives a prettier error message + return fmt.Errorf(errOldCosmosSDKVersionStr, v) //nolint:stylecheck // gives a prettier error message } return nil } diff --git a/ignite/version/version_test.go b/ignite/version/version_test.go index 3bfc533668..c0499c1006 100644 --- a/ignite/version/version_test.go +++ b/ignite/version/version_test.go @@ -19,7 +19,12 @@ func TestAssertSupportedCosmosSDKVersion(t *testing.T) { { "invalid", cosmosver.Version{Version: "invalid"}, - "your chain has been scaffolded with an older version of Cosmos SDK: invalid", + "Your chain has been scaffolded with an older version of Cosmos SDK: invalid", + }, + { + "too old", + cosmosver.Version{Version: "v0.45.0", Semantic: semver.MustParse("0.45.0")}, + "Your chain has been scaffolded with an older version of Cosmos SDK: v0.45.0", }, { "v0.47.3",