-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: restore runtime app API registered module discovery (#3785)
* fix: restore runtime app API registered modules * ci: fix lint issue with unused argument * tests: fix broken unit tests * ci: fix linting issue * feat: add support for IBC modules discovery This is a temporary feature that should be removed once IBC modules are injected inteas of being wired using the definitions from the scafolded app file `app/ibc.go`. * fix: correct issue that cause modules not to be discovered The removed snippet was not able to handle some Go import paths which were removed, like the IBC ones, also causing that the TS client generation was incomplete because of the missing modules. * feat(pkg/xstrings): add `StringBetween` function * fix: discover "cosmossdk.io/x" based packages proto files The "cosmossdk.io/x" Go packages MUST search proto files in the Cosmos SDK Go package because these packages don't have the proto files included so they can't be discovered. * feat(pkg/gocmd): add Go mod download support * feat(pkg/cosmosanalysis): add find module support * refactor(pkg/cosmosanalysis): change Cosmos SDK package path discovery Discovery changed to use go mod download instead of using Go's module path which might not be present in some context. * refactor: add filter function to remove duplicated modules * chore: TS template updates * fix: correct TS imports for generated "cosmossdk.io" module packages * tests: add unit tests for the new `pkg/gomodule` functions * refactor: add options to `pkg/cosmosanalysis` Discover function * fix: Update package.json template --------- Co-authored-by: Danilo Pantani <[email protected]> Co-authored-by: Clockwork <[email protected]>
- Loading branch information
1 parent
fb2b140
commit ab3f5c1
Showing
28 changed files
with
1,166 additions
and
300 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
ignite/pkg/cosmosanalysis/app/testdata/modules/app_config/go.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module app | ||
|
||
go 1.20 | ||
|
||
require ( | ||
cosmossdk.io/api v0.3.1 | ||
cosmossdk.io/core v0.5.1 | ||
cosmossdk.io/depinject v1.0.0-alpha.3 | ||
cosmossdk.io/errors v1.0.0-beta.7 | ||
cosmossdk.io/math v1.0.1 | ||
github.com/bufbuild/buf v1.23.1 | ||
github.com/cometbft/cometbft v0.37.2 | ||
github.com/cometbft/cometbft-db v0.8.0 | ||
github.com/cosmos/cosmos-proto v1.0.0-beta.2 | ||
github.com/cosmos/cosmos-sdk v0.47.3 | ||
github.com/cosmos/gogoproto v1.4.10 | ||
github.com/cosmos/ibc-go/v7 v7.2.0 | ||
github.com/golang/protobuf v1.5.3 | ||
github.com/gorilla/mux v1.8.0 | ||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 | ||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2 | ||
github.com/spf13/cast v1.5.1 | ||
github.com/spf13/cobra v1.7.0 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.8.4 | ||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 | ||
google.golang.org/grpc v1.55.0 | ||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0 | ||
google.golang.org/protobuf v1.31.0 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
ignite/pkg/cosmosanalysis/app/testdata/modules/crescent/go.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module github.com/crescent-network/crescent/v5 | ||
|
||
go 1.18 | ||
|
||
require ( | ||
github.com/cosmos/cosmos-sdk v0.45.10 | ||
github.com/cosmos/ibc-go/v3 v3.4.0 | ||
github.com/gogo/protobuf v1.3.3 | ||
github.com/golang/mock v1.6.0 | ||
github.com/golang/protobuf v1.5.2 | ||
github.com/golangci/golangci-lint v1.50.1 | ||
github.com/gorilla/mux v1.8.0 | ||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 | ||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.13.0 | ||
github.com/rakyll/statik v0.1.7 | ||
github.com/regen-network/cosmos-proto v0.3.1 | ||
github.com/spf13/cast v1.5.0 | ||
github.com/spf13/cobra v1.6.0 | ||
github.com/spf13/pflag v1.0.5 | ||
github.com/stretchr/testify v1.8.0 | ||
github.com/tendermint/tendermint v0.34.22 | ||
github.com/tendermint/tm-db v0.6.7 | ||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e | ||
google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c | ||
google.golang.org/grpc v1.50.1 | ||
google.golang.org/protobuf v1.28.1 | ||
gopkg.in/yaml.v2 v2.4.0 | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
ignite/pkg/cosmosanalysis/app/testdata/modules/gaia/go.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module github.com/cosmos/gaia/v14 | ||
|
||
go 1.20 | ||
|
||
require ( | ||
cosmossdk.io/errors v1.0.0 | ||
cosmossdk.io/math v1.2.0 | ||
github.com/cosmos/cosmos-sdk v0.45.16 | ||
github.com/cosmos/go-bip39 v1.0.0 | ||
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v4 v4.1.1 | ||
github.com/cosmos/ibc-go/v4 v4.4.2 | ||
github.com/cosmos/interchain-security/v2 v2.0.0 | ||
github.com/gogo/protobuf v1.3.3 | ||
github.com/golang/protobuf v1.5.3 | ||
github.com/google/gofuzz v1.2.0 | ||
github.com/gorilla/mux v1.8.1 | ||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 | ||
github.com/ory/dockertest/v3 v3.10.0 | ||
github.com/rakyll/statik v0.1.7 | ||
github.com/spf13/cast v1.5.1 | ||
github.com/spf13/cobra v1.8.0 | ||
github.com/spf13/viper v1.17.0 | ||
github.com/stretchr/testify v1.8.4 | ||
github.com/tendermint/tendermint v0.34.27 | ||
github.com/tendermint/tm-db v0.6.7 | ||
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb | ||
google.golang.org/grpc v1.58.2 | ||
) |
33 changes: 33 additions & 0 deletions
33
ignite/pkg/cosmosanalysis/app/testdata/modules/juno/go.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module github.com/CosmosContracts/juno/v18 | ||
|
||
go 1.21 | ||
|
||
require ( | ||
cosmossdk.io/api v0.3.1 | ||
cosmossdk.io/errors v1.0.0 | ||
cosmossdk.io/log v1.2.1 | ||
cosmossdk.io/math v1.1.2 | ||
cosmossdk.io/tools/rosetta v0.2.1 | ||
github.com/CosmWasm/wasmd v0.45.0 | ||
github.com/CosmWasm/wasmvm v1.5.0 | ||
github.com/cometbft/cometbft v0.37.2 | ||
github.com/cometbft/cometbft-db v0.8.0 | ||
github.com/cosmos/cosmos-sdk v0.47.5 | ||
github.com/cosmos/gogoproto v1.4.10 | ||
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7 v7.0.1 | ||
github.com/cosmos/ibc-apps/modules/async-icq/v7 v7.0.0 | ||
github.com/cosmos/ibc-apps/modules/ibc-hooks/v7 v7.0.0-20230803181732-7c8f814d3b79 | ||
github.com/cosmos/ibc-go/v7 v7.3.1 | ||
github.com/golang/protobuf v1.5.3 | ||
github.com/gorilla/mux v1.8.0 | ||
github.com/grpc-ecosystem/grpc-gateway v1.16.0 | ||
github.com/prometheus/client_golang v1.16.0 | ||
github.com/skip-mev/pob v1.0.4 | ||
github.com/spf13/cast v1.5.1 | ||
github.com/spf13/cobra v1.7.0 | ||
github.com/spf13/viper v1.16.0 | ||
github.com/stretchr/testify v1.8.4 | ||
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 | ||
google.golang.org/grpc v1.58.3 | ||
gopkg.in/yaml.v2 v2.4.0 | ||
) |
Oops, something went wrong.