-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat!: integrate autocli and reflection services with simapp legacy #13746
Changes from 2 commits
d41c58f
1943aab
dec8acc
de5c51b
b2c56b1
38064e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ import ( | |
"os" | ||
"path/filepath" | ||
|
||
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" | ||
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" | ||
"github.com/spf13/cast" | ||
abci "github.com/tendermint/tendermint/abci/types" | ||
"github.com/tendermint/tendermint/libs/log" | ||
|
@@ -23,6 +25,7 @@ import ( | |
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/runtime" | ||
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services" | ||
"github.com/cosmos/cosmos-sdk/server" | ||
"github.com/cosmos/cosmos-sdk/server/api" | ||
"github.com/cosmos/cosmos-sdk/server/config" | ||
|
@@ -430,6 +433,14 @@ func NewSimApp( | |
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) | ||
app.ModuleManager.RegisterServices(app.configurator) | ||
|
||
autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. love it thank you!! |
||
|
||
reflectionSvc, err := runtimeservices.NewReflectionService() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's maybe add a quick note in upgrading.md for v0.47 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @ilgooz for visibility on this feature |
||
if err != nil { | ||
panic(err) | ||
} | ||
reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc) | ||
|
||
// add test gRPC service for testing gRPC queries in isolation | ||
testdata_pulsar.RegisterQueryServer(app.GRPCQueryRouter(), testdata_pulsar.QueryImpl{}) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this line specifically, but why didn't we make runtime a go.mod?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't yet because all modules depend on runtime and runtime depends on baseapp and types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the downvote @julienrbrt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the split for tools, or things that needs to iterate faster than the SDK.
If we extract runtime, this means different modules could have different version of runtime.
This adds a variable of what a module must be compatible to. It makes for sense if you have modules compatible with SDK versions only and not additionally runtime. These (runtime + sdk types) seems so tight to each another anyway that I, personally, don't understand the added value.
Unless I am missing something.