8000 feat(network): disable create command for Launchpad apps by ilgooz · Pull Request #586 · ignite/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(network): disable create command for Launchpad apps #586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ require (
github.com/tendermint/spn v0.0.0-20201215081711-b9ec9286ed83
github.com/tendermint/tendermint v0.34.0-rc6
golang.org/x/crypto v0.0.0-20201217014255-9d1352758620 // indirect
golang.org/x/mod v0.3.0
golang.org/x/mod v0.4.0
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 // indirect
golang.org/x/sys v0.0.0-20201221093633-bc327ba9c2f0 // indirect
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf // indirect
google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154 // indirect
google.golang.org/grpc v1.33.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -926,8 10000 +928,8 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201018230417-eeed37f84f13/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742 h1:+CBz4km/0KPU3RGTwARGh/noP3bEwtHcq+0YcBQM2JQ=
golang.org/x/sys v0.0.0-20201218084310-7d0127a74742/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201221093633-bc327ba9c2f0 h1:n+DPcgTwkgWzIFpLmoimYR2K2b0Ga5+Os4kayIN0vGo=
golang.org/x/sys v0.0.0-20201221093633-bc327ba9c2f0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf h1:MZ2shdL+ZM/XzY3ZGOnh4Nlpnxz5GSOhOmtHo3iPU6M=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
2 changes: 1 addition & 1 deletion integration/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const (
// Scaffold scaffolds an app to a unique appPath and returns it.
func (e env) Scaffold(appName, sdkVersion string) (appPath string) {
root := e.TmpDir()
e.Exec("scaffold a launchpad app",
e.Exec("scaffold an app",
step.NewSteps(step.New(
step.Exec(
"starport",
Expand Down
9 changes: 5 additions & 4 deletions starport/pkg/cosmosver/cosmosver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strings"

"github.com/tendermint/starport/starport/pkg/gomodule"
"golang.org/x/mod/semver"
)

type MajorVersion string
Expand All @@ -21,8 +22,8 @@ const (
var MajorVersions = majorVersions{Launchpad, Stargate}

const (
tendermintPath = "github.com/tendermint/tendermint"
cosmosStargateTendermintMajor = "v0.34.0"
referenceModulePath = "github.com/cosmos/cosmos-sdk"
referenceModuleLatestTag = "v0.39.99"
)

// Detect dedects major version of Cosmos.
Expand All @@ -33,8 +34,8 @@ func Detect(appPath string) (MajorVersion, error) {
}
for _, r := range parsed.Require {
v := r.Mod
if v.Path == tendermintPath {
if strings.HasPrefix(v.Version, cosmosStargateTendermintMajor) {
if v.Path == referenceModulePath {
if semver.Compare(v.Version, referenceModuleLatestTag) >= 0 {
return Stargate, nil
}
break
Expand Down
6 changes: 6 additions & 0 deletions starport/services/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/go-git/go-git/v5"
"github.com/gookit/color"
"github.com/tendermint/starport/starport/pkg/cosmosver"
"github.com/tendermint/starport/starport/services/chain/conf"
secretconf "github.com/tendermint/starport/starport/services/chain/conf/secret"
)
Expand Down Expand Up @@ -104,6 +105,11 @@ func (c *Chain) appVersion() (v version, err error) {
return v, nil
}

// SDKVersion returns the version of SDK used to build the blockchain.
func (c *Chain) SDKVersion() cosmosver.MajorVersion {
return c.plugin.Version()
}

// RPCPublicAddress points to the public address of Tendermint RPC, this is shared by
// other chains for relayer related actions.
func (c *Chain) RPCPublicAddress() (string, error) {
Expand Down
6 changes: 6 additions & 0 deletions starport/services/networkbuilder/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package networkbuilder

import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"

"github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/starport/starport/pkg/cosmosver"
"github.com/tendermint/starport/starport/pkg/events"
"github.com/tendermint/starport/starport/pkg/gomodulepath"
"github.com/tendermint/starport/starport/pkg/jsondoc"
Expand Down Expand Up @@ -57,6 +59,10 @@ func (b *Blockchain) init(ctx context.Context, chainID string, mustNotInitialize
return err
}

if v := c.SDKVersion(); v != cosmosver.Stargate {
return errors.New("starport doesn't support Cosmos SDK Launchpad blockchains")
}

if mustNotInitializedBefore {
if _, err := os.Stat(c.Home()); !os.IsNotExist(err) {
return &DataDirExistsError{chainID, c.Home()}
Expand Down
0