Skip to content

Commit

Permalink
add registry and check if sdk is greater o equal than v0.51
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Aug 29, 2024
1 parent 1d72e78 commit acbd971
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
32 changes: 32 additions & 0 deletions _registry/ignite.apps.fee-abstraction.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"appName": "fee-abstraction",
"appDescription": "Integrate the fee abstraction module from osmosis-labs to make it easy for new chains to accept the currencies of existing chains",
"ignite": ">28.5.2",
"dependencies": {},
"cosmosSDK": ">0.50.8",
"authors": [
{
"name": "Danilo Pantani",
"github": "Pantani"
}
],
"repositoryUrl": "https://github.com/ignite/apps",
"documentationUrl": "https://github.com/ignite/apps/blob/main/fee-abstraction/README.md",
"license": {
"name": "MIT",
"url": "https://github.com/ignite/apps/blob/main/LICENSE"
},
"keywords": [
"scaffolder",
"fee-abstraction",
"osmosis",
"osmosis-labs",
"cli",
"cosmos-sdk",
"ignite app"
],
"supportedPlatforms": [
"mac",
"linux"
]
}
13 changes: 11 additions & 2 deletions fee-abstraction/services/scaffolder/scaffolder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const (
errOldCosmosSDKVersionStr = `Your chain has been scaffolded with an older version of Cosmos SDK: %s
Please, follow the migration guide to upgrade your chain to the latest version at https://docs.ignite.com/migration`
errNewCosmosSDKVersionStr = "Your chain has been scaffolded with the new version (%s) of Cosmos SDK greater than %s"
)

// Scaffolder is fee abstraction app scaffolder.
Expand All @@ -38,8 +39,16 @@ func New(c *chain.Chain, session *cliui.Session) (Scaffolder, error) {

// assertSupportedCosmosSDKVersion asserts that a Cosmos SDK version is supported by Ignite CLI.
func assertSupportedCosmosSDKVersion(v cosmosver.Version) error {
if v.LT(cosmosver.StargateFiftyVersion) {
return errors.Errorf(errOldCosmosSDKVersionStr, v)
v0501 := cosmosver.StargateFiftyVersion
v0510, err := cosmosver.Parse("0.51.0")
if err != nil {
return err
}
switch {
case v.LT(v0501):
return errors.Errorf(errOldCosmosSDKVersionStr, v.String())
case v.GTE(v0510):
return errors.Errorf(errNewCosmosSDKVersionStr, v.String(), v0510.String())
}
return nil
}
Expand Down

0 comments on commit acbd971

Please sign in to comment.