diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8fdc55fdbe67..e69e595ceaa3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (grpc) [#13485](https://github.com/cosmos/cosmos-sdk/pull/13485) Implement a new gRPC query, `/cosmos/base/node/v1beta1/config`, which provides operator configuration. Applications that wish to expose operator minimum gas prices via gRPC should have their application implement the `ApplicationQueryService` interface (see `SimApp#RegisterNodeService` as an example).
* [#13557](https://github.com/cosmos/cosmos-sdk/pull/#13557) - Add `GenSignedMockTx`. This can be used as workaround for #12437 revertion. `v0.46+` contains as well a `GenSignedMockTx` that behaves the same way.
+* (x/auth) [#13612](https://github.com/cosmos/cosmos-sdk/pull/13612) Add `Query/ModuleAccountByName` endpoint for accessing the module account info by module name.
### Improvements
diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md
index a25269b0c3a8..808904049f2f 100644
--- a/docs/core/proto-docs.md
+++ b/docs/core/proto-docs.md
@@ -21,6 +21,8 @@
- [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse)
- [QueryAccountsRequest](#cosmos.auth.v1beta1.QueryAccountsRequest)
- [QueryAccountsResponse](#cosmos.auth.v1beta1.QueryAccountsResponse)
+ - [QueryModuleAccountByNameRequest](#cosmos.auth.v1beta1.QueryModuleAccountByNameRequest)
+ - [QueryModuleAccountByNameResponse](#cosmos.auth.v1beta1.QueryModuleAccountByNameResponse)
- [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest)
- [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse)
@@ -846,6 +848,36 @@ Since: cosmos-sdk 0.43
+
+
+### QueryModuleAccountByNameRequest
+QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `name` | [string](#string) | | |
+
+
+
+
+
+
+
+
+### QueryModuleAccountByNameResponse
+QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| `account` | [google.protobuf.Any](#google.protobuf.Any) | | |
+
+
+
+
+
+
### QueryParamsRequest
@@ -889,6 +921,7 @@ Query defines the gRPC querier service.
Since: cosmos-sdk 0.43 | GET|/cosmos/auth/v1beta1/accounts|
| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}|
| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params|
+| `ModuleAccountByName` | [QueryModuleAccountByNameRequest](#cosmos.auth.v1beta1.QueryModuleAccountByNameRequest) | [QueryModuleAccountByNameResponse](#cosmos.auth.v1beta1.QueryModuleAccountByNameResponse) | ModuleAccountByName returns the module account info by module name | GET|/cosmos/auth/v1beta1/module_accounts/{name}|
diff --git a/proto/cosmos/auth/v1beta1/query.proto b/proto/cosmos/auth/v1beta1/query.proto
index 4d9759cada6b..79799a4b71aa 100644
--- a/proto/cosmos/auth/v1beta1/query.proto
+++ b/proto/cosmos/auth/v1beta1/query.proto
@@ -28,6 +28,11 @@ service Query {
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/cosmos/auth/v1beta1/params";
}
+
+ // ModuleAccountByName returns the module account info by module name
+ rpc ModuleAccountByName(QueryModuleAccountByNameRequest) returns (QueryModuleAccountByNameResponse) {
+ option (google.api.http).get = "/cosmos/auth/v1beta1/module_accounts/{name}";
+ }
}
// QueryAccountsRequest is the request type for the Query/Accounts RPC method.
@@ -72,3 +77,13 @@ message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
}
+
+// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method.
+message QueryModuleAccountByNameRequest {
+ string name = 1;
+}
+
+// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method.
+message QueryModuleAccountByNameResponse {
+ google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "ModuleAccountI"];
+}
\ No newline at end of file
diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go
index e38dac0e3dd6..b74d3529738c 100644
--- a/x/auth/client/cli/query.go
+++ b/x/auth/client/cli/query.go
@@ -1,6 +1,7 @@
package cli
import (
+ "context"
"fmt"
"strings"
@@ -43,6 +44,7 @@ func GetQueryCmd() *cobra.Command {
GetAccountCmd(),
GetAccountsCmd(),
QueryParamsCmd(),
+ QueryModuleAccountByNameCmd(),
)
return cmd
@@ -143,6 +145,40 @@ func GetAccountsCmd() *cobra.Command {
return cmd
}
+// QueryModuleAccountByNameCmd returns a command to
+func QueryModuleAccountByNameCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "module-account [module-name]",
+ Short: "Query module account info by module name",
+ Args: cobra.ExactArgs(1),
+ Example: fmt.Sprintf("%s q auth module-account auth", version.AppName),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientQueryContext(cmd)
+ if err != nil {
+ return err
+ }
+
+ moduleName := args[0]
+ if len(moduleName) == 0 {
+ return fmt.Errorf("module name should not be empty")
+ }
+
+ queryClient := types.NewQueryClient(clientCtx)
+
+ res, err := queryClient.ModuleAccountByName(context.Background(), &types.QueryModuleAccountByNameRequest{Name: moduleName})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+
+ return cmd
+}
+
// QueryTxsByEventsCmd returns a command to search through transactions by events.
func QueryTxsByEventsCmd() *cobra.Command {
cmd := &cobra.Command{
diff --git a/x/auth/client/testutil/suite.go b/x/auth/client/testutil/suite.go
index 9e6fd2f03408..822bb2b3e00d 100644
--- a/x/auth/client/testutil/suite.go
+++ b/x/auth/client/testutil/suite.go
@@ -1131,6 +1131,54 @@ func (s *IntegrationTestSuite) TestGetAccountsCmd() {
s.Require().NotEmpty(res.Accounts)
}
+func (s *IntegrationTestSuite) TestQueryModuleAccountByNameCmd() {
+ val := s.network.Validators[0]
+
+ testCases := []struct {
+ name string
+ moduleName string
+ expectErr bool
+ }{
+ {
+ "invalid module name",
+ "gover",
+ true,
+ },
+ {
+ "valid module name",
+ "mint",
+ false,
+ },
+ }
+
+ for _, tc := range testCases {
+ tc := tc
+ s.Run(tc.name, func() {
+ clientCtx := val.ClientCtx
+
+ out, err := clitestutil.ExecTestCLICmd(clientCtx, authcli.QueryModuleAccountByNameCmd(), []string{
+ tc.moduleName,
+ fmt.Sprintf("--%s=json", tmcli.OutputFlag),
+ })
+ if tc.expectErr {
+ s.Require().Error(err)
+ s.Require().NotEqual("internal", err.Error())
+ } else {
+ var res authtypes.QueryModuleAccountByNameResponse
+ s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res))
+
+ var account authtypes.AccountI
+ err := val.ClientCtx.InterfaceRegistry.UnpackAny(res.Account, &account)
+ s.Require().NoError(err)
+
+ moduleAccount, ok := account.(authtypes.ModuleAccountI)
+ s.Require().True(ok)
+ s.Require().Equal(tc.moduleName, moduleAccount.GetName())
+ }
+ })
+ }
+}
+
func TestGetBroadcastCommandOfflineFlag(t *testing.T) {
clientCtx := client.Context{}.WithOffline(true)
clientCtx = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig) //nolint:staticcheck
diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go
index 344113cfa019..79da18f7cf98 100644
--- a/x/auth/keeper/grpc_query.go
+++ b/x/auth/keeper/grpc_query.go
@@ -81,3 +81,28 @@ func (ak AccountKeeper) Params(c context.Context, req *types.QueryParamsRequest)
return &types.QueryParamsResponse{Params: params}, nil
}
+
+// ModuleAccountByName returns module account by module name
+func (ak AccountKeeper) ModuleAccountByName(c context.Context, req *types.QueryModuleAccountByNameRequest) (*types.QueryModuleAccountByNameResponse, error) {
+ if req == nil {
+ return nil, status.Errorf(codes.InvalidArgument, "empty request")
+ }
+
+ if len(req.Name) == 0 {
+ return nil, status.Error(codes.InvalidArgument, "module name is empty")
+ }
+
+ ctx := sdk.UnwrapSDKContext(c)
+ moduleName := req.Name
+
+ account := ak.GetModuleAccount(ctx, moduleName)
+ if account == nil {
+ return nil, status.Errorf(codes.NotFound, "account %s not found", moduleName)
+ }
+ any, err := codectypes.NewAnyWithValue(account)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, err.Error())
+ }
+
+ return &types.QueryModuleAccountByNameResponse{Account: any}, nil
+}
diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go
index 789ca3c7ef31..2a6f5a6d6d87 100644
--- a/x/auth/keeper/grpc_query_test.go
+++ b/x/auth/keeper/grpc_query_test.go
@@ -187,3 +187,58 @@ func (suite *KeeperTestSuite) TestGRPCQueryParameters() {
})
}
}
+
+func (suite *KeeperTestSuite) TestGRPCQueryModuleAccountByName() {
+ var req *types.QueryModuleAccountByNameRequest
+
+ testCases := []struct {
+ msg string
+ malleate func()
+ expPass bool
+ posttests func(res *types.QueryModuleAccountByNameResponse)
+ }{
+ {
+ "success",
+ func() {
+ req = &types.QueryModuleAccountByNameRequest{Name: "mint"}
+ },
+ true,
+ func(res *types.QueryModuleAccountByNameResponse) {
+ var account types.AccountI
+ err := suite.app.InterfaceRegistry().UnpackAny(res.Account, &account)
+ suite.Require().NoError(err)
+
+ moduleAccount, ok := account.(types.ModuleAccountI)
+ suite.Require().True(ok)
+ suite.Require().Equal(moduleAccount.GetName(), "mint")
+ },
+ },
+ {
+ "invalid module name",
+ func() {
+ req = &types.QueryModuleAccountByNameRequest{Name: "gover"}
+ },
+ false,
+ func(res *types.QueryModuleAccountByNameResponse) {
+ },
+ },
+ }
+
+ for _, tc := range testCases {
+ suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
+ suite.SetupTest() // reset
+ tc.malleate()
+ ctx := sdk.WrapSDKContext(suite.ctx)
+ res, err := suite.queryClient.ModuleAccountByName(ctx, req)
+ if tc.expPass {
+ suite.Require().NoError(err)
+ suite.Require().NotNil(res)
+ } else {
+ suite.Require().Error(err)
+ suite.Require().Nil(res)
+ }
+
+ tc.posttests(res)
+ })
+ }
+}
diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go
index 4150c3f6ff16..22fc3476fe03 100644
--- a/x/auth/types/query.pb.go
+++ b/x/auth/types/query.pb.go
@@ -305,6 +305,96 @@ func (m *QueryParamsResponse) GetParams() Params {
return Params{}
}
+// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method.
+type QueryModuleAccountByNameRequest struct {
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (m *QueryModuleAccountByNameRequest) Reset() { *m = QueryModuleAccountByNameRequest{} }
+func (m *QueryModuleAccountByNameRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryModuleAccountByNameRequest) ProtoMessage() {}
+func (*QueryModuleAccountByNameRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_c451370b3929a27c, []int{6}
+}
+func (m *QueryModuleAccountByNameRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryModuleAccountByNameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryModuleAccountByNameRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryModuleAccountByNameRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryModuleAccountByNameRequest.Merge(m, src)
+}
+func (m *QueryModuleAccountByNameRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryModuleAccountByNameRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryModuleAccountByNameRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryModuleAccountByNameRequest proto.InternalMessageInfo
+
+func (m *QueryModuleAccountByNameRequest) GetName() string {
+ if m != nil {
+ return m.Name
+ }
+ return ""
+}
+
+// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method.
+type QueryModuleAccountByNameResponse struct {
+ Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
+}
+
+func (m *QueryModuleAccountByNameResponse) Reset() { *m = QueryModuleAccountByNameResponse{} }
+func (m *QueryModuleAccountByNameResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryModuleAccountByNameResponse) ProtoMessage() {}
+func (*QueryModuleAccountByNameResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_c451370b3929a27c, []int{7}
+}
+func (m *QueryModuleAccountByNameResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryModuleAccountByNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryModuleAccountByNameResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryModuleAccountByNameResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryModuleAccountByNameResponse.Merge(m, src)
+}
+func (m *QueryModuleAccountByNameResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryModuleAccountByNameResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryModuleAccountByNameResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryModuleAccountByNameResponse proto.InternalMessageInfo
+
+func (m *QueryModuleAccountByNameResponse) GetAccount() *types.Any {
+ if m != nil {
+ return m.Account
+ }
+ return nil
+}
+
func init() {
proto.RegisterType((*QueryAccountsRequest)(nil), "cosmos.auth.v1beta1.QueryAccountsRequest")
proto.RegisterType((*QueryAccountsResponse)(nil), "cosmos.auth.v1beta1.QueryAccountsResponse")
@@ -312,46 +402,54 @@ func init() {
proto.RegisterType((*QueryAccountResponse)(nil), "cosmos.auth.v1beta1.QueryAccountResponse")
proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.auth.v1beta1.QueryParamsRequest")
proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.auth.v1beta1.QueryParamsResponse")
+ proto.RegisterType((*QueryModuleAccountByNameRequest)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameRequest")
+ proto.RegisterType((*QueryModuleAccountByNameResponse)(nil), "cosmos.auth.v1beta1.QueryModuleAccountByNameResponse")
}
func init() { proto.RegisterFile("cosmos/auth/v1beta1/query.proto", fileDescriptor_c451370b3929a27c) }
var fileDescriptor_c451370b3929a27c = []byte{
- // 537 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x41, 0x6b, 0x13, 0x4f,
- 0x18, 0xc6, 0x77, 0xda, 0xff, 0x3f, 0x89, 0x53, 0x4f, 0xd3, 0x08, 0x71, 0x6b, 0x77, 0xcb, 0x8a,
- 0x26, 0x29, 0x74, 0x86, 0xc6, 0x53, 0x45, 0x84, 0x46, 0x50, 0xbc, 0xc5, 0xc5, 0x93, 0x07, 0x65,
- 0x36, 0x19, 0xb7, 0x41, 0xb3, 0xb3, 0xcd, 0xec, 0x8a, 0x41, 0x04, 0xf1, 0xd4, 0x9b, 0x82, 0x5f,
- 0x20, 0x37, 0xbf, 0x80, 0x1f, 0xa2, 0x78, 0x2a, 0x78, 0xf1, 0x24, 0x92, 0x78, 0xf0, 0x63, 0x48,
- 0x66, 0xde, 0x89, 0x8d, 0xac, 0x26, 0xa7, 0xdd, 0x99, 0x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0x8f, 0xd4, 0xff, 0x1e, 0xb3, 0x70, 0x59, 0x6e, 0x63, 0x79, 0x21, 0xe0, 0x5c, 0xd5,
- 0x38, 0xdb, 0x64, 0xab, 0x10, 0xc7, 0xdc, 0x54, 0xfb, 0xce, 0xe9, 0xc4, 0x43, 0x67, 0x13, 0x0f,
- 0x7d, 0x9f, 0x78, 0xe8, 0xfd, 0xd4, 0x73, 0xce, 0xa6, 0x9e, 0xf3, 0x75, 0xea, 0x39, 0x8f, 0x9a,
- 0x71, 0x3f, 0x3b, 0xca, 0x23, 0xda, 0x95, 0x03, 0x6b, 0x60, 0x3e, 0x7b, 0xaa, 0xf7, 0x8c, 0xbd,
- 0x34, 0x6e, 0xd9, 0x28, 0x15, 0x2a, 0x2a, 0xe9, 0xb7, 0x77, 0xe3, 0x57, 0x00, 0x00, 0x00, 0xff,
- 0xff, 0x2a, 0xe1, 0x81, 0xd3, 0xdf, 0x04, 0x00, 0x00,
+ // 625 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6b, 0x13, 0x4f,
+ 0x18, 0xc7, 0x77, 0xfb, 0xeb, 0x2f, 0x89, 0x53, 0xf1, 0x30, 0x89, 0x10, 0xb7, 0x76, 0x37, 0xac,
+ 0x68, 0x92, 0x4a, 0x66, 0x69, 0x6a, 0x0f, 0x15, 0x11, 0x1a, 0x41, 0xf1, 0xa0, 0xc4, 0xe0, 0xc9,
+ 0x83, 0x65, 0x92, 0x4c, 0xb7, 0xc1, 0xee, 0xce, 0x36, 0xb3, 0x2b, 0x06, 0x29, 0x88, 0xa7, 0xde,
+ 0x14, 0x7c, 0x03, 0x79, 0x11, 0x05, 0xdf, 0x42, 0xe9, 0xa9, 0xe0, 0xc5, 0x93, 0x68, 0xe2, 0xc1,
+ 0x97, 0x21, 0x99, 0x79, 0x36, 0x69, 0x64, 0x63, 0xe2, 0x69, 0xe7, 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0x62, 0x63, 0x7d, 0x91, 0x50, 0x45, 0x6c, 0xdf, 0x7c, 0xff, 0xe5, 0xe7, 0xa7, 0x25, 0x0b,
+ 0xaf, 0x39, 0x89, 0x3f, 0x53, 0xec, 0xfe, 0x41, 0x47, 0x69, 0xd0, 0xe2, 0xd2, 0xdc, 0xf4, 0x31,
+ 0x48, 0x79, 0x81, 0x48, 0xe0, 0x70, 0x24, 0x47, 0x19, 0x17, 0xff, 0xca, 0xe1, 0xbc, 0x85, 0x61,
+ 0x3c, 0xc2, 0xef, 0x74, 0x94, 0x52, 0xcf, 0x8b, 0x8b, 0xb3, 0x6d, 0xa6, 0x66, 0xc9, 0x28, 0xcd,
+ 0x0f, 0x04, 0x9c, 0x1b, 0x12, 0x67, 0x0d, 0xaf, 0x26, 0xe2, 0xa8, 0x41, 0xc2, 0x9f, 0x75, 0x94,
+ 0x4d, 0x98, 0x06, 0x7c, 0x67, 0xb6, 0xcd, 0xec, 0x99, 0x33, 0xb6, 0xfe, 0x51, 0x05, 0xa4, 0x9b,
+ 0x92, 0xb4, 0x82, 0x6f, 0x27, 0x92, 0x7a, 0x52, 0xb9, 0x3b, 0xe9, 0xdf, 0x68, 0x94, 0x8f, 0x6a,
+ 0x0f, 0x4e, 0x07, 0xa6, 0x7e, 0x3e, 0x30, 0xf5, 0xef, 0x03, 0x53, 0xff, 0x38, 0x34, 0xb5, 0xf3,
+ 0xa1, 0xa9, 0x7d, 0x1d, 0x9a, 0xda, 0x8b, 0xb2, 0xdb, 0x09, 0xf7, 0xa3, 0x26, 0x69, 0x71, 0x2f,
+ 0x4e, 0xa8, 0x3e, 0x15, 0xd1, 0x7e, 0xe5, 0xbc, 0x51, 0xd9, 0xc3, 0x5e, 0xc0, 0x44, 0x33, 0x25,
+ 0x67, 0x7a, 0xf3, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xde, 0x85, 0xd2, 0xba, 0x38, 0x06, 0x00,
+ 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -374,6 +472,8 @@ type QueryClient interface {
Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
// Params queries all parameters.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
+ // ModuleAccountByName returns the module account info by module name
+ ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error)
}
type queryClient struct {
@@ -411,6 +511,15 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil
}
+func (c *queryClient) ModuleAccountByName(ctx context.Context, in *QueryModuleAccountByNameRequest, opts ...grpc.CallOption) (*QueryModuleAccountByNameResponse, error) {
+ out := new(QueryModuleAccountByNameResponse)
+ err := c.cc.Invoke(ctx, "/cosmos.auth.v1beta1.Query/ModuleAccountByName", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// QueryServer is the server API for Query service.
type QueryServer interface {
// Accounts returns all the existing accounts
@@ -421,6 +530,8 @@ type QueryServer interface {
Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
// Params queries all parameters.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
+ // ModuleAccountByName returns the module account info by module name
+ ModuleAccountByName(context.Context, *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error)
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
@@ -436,6 +547,9 @@ func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountR
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
+func (*UnimplementedQueryServer) ModuleAccountByName(ctx context.Context, req *QueryModuleAccountByNameRequest) (*QueryModuleAccountByNameResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ModuleAccountByName not implemented")
+}
func RegisterQueryServer(s grpc1.Server, srv QueryServer) {
s.RegisterService(&_Query_serviceDesc, srv)
@@ -495,6 +609,24 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler)
}
+func _Query_ModuleAccountByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryModuleAccountByNameRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).ModuleAccountByName(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmos.auth.v1beta1.Query/ModuleAccountByName",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).ModuleAccountByName(ctx, req.(*QueryModuleAccountByNameRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
var _Query_serviceDesc = grpc.ServiceDesc{
ServiceName: "cosmos.auth.v1beta1.Query",
HandlerType: (*QueryServer)(nil),
@@ -511,6 +643,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
+ {
+ MethodName: "ModuleAccountByName",
+ Handler: _Query_ModuleAccountByName_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "cosmos/auth/v1beta1/query.proto",
@@ -721,6 +857,71 @@ func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
+func (m *QueryModuleAccountByNameRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryModuleAccountByNameRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryModuleAccountByNameRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Name) > 0 {
+ i -= len(m.Name)
+ copy(dAtA[i:], m.Name)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Name)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryModuleAccountByNameResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryModuleAccountByNameResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryModuleAccountByNameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if m.Account != nil {
+ {
+ size, err := m.Account.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintQuery(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
offset -= sovQuery(v)
base := offset
@@ -810,6 +1011,32 @@ func (m *QueryParamsResponse) Size() (n int) {
return n
}
+func (m *QueryModuleAccountByNameRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Name)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryModuleAccountByNameResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if m.Account != nil {
+ l = m.Account.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
func sovQuery(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -1323,6 +1550,174 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
+func (m *QueryModuleAccountByNameRequest) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: QueryModuleAccountByNameRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryModuleAccountByNameRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Name = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryModuleAccountByNameResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: QueryModuleAccountByNameResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryModuleAccountByNameResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if m.Account == nil {
+ m.Account = &types.Any{}
+ }
+ if err := m.Account.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
func skipQuery(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/auth/types/query.pb.gw.go b/x/auth/types/query.pb.gw.go
index f6d93f2924f2..3836985c2c3e 100644
--- a/x/auth/types/query.pb.gw.go
+++ b/x/auth/types/query.pb.gw.go
@@ -139,6 +139,60 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
}
+func request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryModuleAccountByNameRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ msg, err := client.ModuleAccountByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_ModuleAccountByName_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryModuleAccountByNameRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ msg, err := server.ModuleAccountByName(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
// UnaryRPC :call QueryServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -205,6 +259,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
})
+ mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, server, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -306,6 +380,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
})
+ mux.Handle("GET", pattern_Query_ModuleAccountByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_ModuleAccountByName_0(rctx, inboundMarshaler, client, req, pathParams)
+ ctx = runtime.NewServerMetadataContext(ctx, md)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Query_ModuleAccountByName_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -315,6 +409,8 @@ var (
pattern_Query_Account_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "accounts", "address"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmos", "auth", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_ModuleAccountByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "auth", "v1beta1", "module_accounts", "name"}, "", runtime.AssumeColonVerbOpt(false)))
)
var (
@@ -323,4 +419,6 @@ var (
forward_Query_Account_0 = runtime.ForwardResponseMessage
forward_Query_Params_0 = runtime.ForwardResponseMessage
+
+ forward_Query_ModuleAccountByName_0 = runtime.ForwardResponseMessage
)