From 61d0c4adcd14f867ffa87589628fe33f8ee9a49e Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Tue, 21 Jul 2020 16:04:51 +0200 Subject: [PATCH] proto: Consistent naming for Params (#6803) * Use consistent "Params" in proto * Update comments Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> --- proto/cosmos/auth/query.proto | 12 +- proto/cosmos/gov/query.proto | 2 +- proto/cosmos/params/query.proto | 12 +- proto/cosmos/slashing/query.proto | 4 +- proto/cosmos/staking/query.proto | 4 +- x/auth/keeper/grpc_query.go | 6 +- x/auth/keeper/grpc_query_test.go | 6 +- x/auth/keeper/querier_test.go | 4 +- x/auth/types/account_retriever.go | 2 +- x/auth/types/account_retriever_test.go | 2 +- x/auth/types/querier.go | 14 -- x/auth/types/query.pb.go | 175 ++++++++++++------------- x/gov/types/query.pb.go | 4 +- x/params/client/cli/query.go | 4 +- x/params/keeper/grpc_query.go | 6 +- x/params/keeper/grpc_query_test.go | 14 +- x/params/types/proposal/proposal.go | 8 -- x/params/types/proposal/query.pb.go | 160 +++++++++++----------- x/slashing/types/query.pb.go | 4 +- x/staking/types/query.pb.go | 4 +- 20 files changed, 212 insertions(+), 235 deletions(-) diff --git a/proto/cosmos/auth/query.proto b/proto/cosmos/auth/query.proto index 2b8fca0252..1ea76372bd 100644 --- a/proto/cosmos/auth/query.proto +++ b/proto/cosmos/auth/query.proto @@ -13,8 +13,8 @@ service Query{ // Account returns account details based on address rpc Account (QueryAccountRequest) returns (QueryAccountResponse) {} - // Parameters queries all params - rpc Parameters (QueryParametersRequest) returns (QueryParametersResponse) {} + // Params queries all parameters + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {} } // QueryAccountRequest is request type for the Query/Account RPC method @@ -27,10 +27,10 @@ message QueryAccountResponse{ google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; } -// QueryParametersRequest is request type for the Query/Parameters RPC method -message QueryParametersRequest{ } +// QueryParamsRequest is request type for the Query/Params RPC method +message QueryParamsRequest{ } -// QueryParametersResponse is response type for the Query/Parameters RPC method -message QueryParametersResponse{ +// QueryParamsResponse is response type for the Query/Params RPC method +message QueryParamsResponse{ cosmos.auth.Params params = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/gov/query.proto b/proto/cosmos/gov/query.proto index b9d0ce7b3a..01dd28f124 100644 --- a/proto/cosmos/gov/query.proto +++ b/proto/cosmos/gov/query.proto @@ -21,7 +21,7 @@ service Query { // Votes queries votes of a given proposal rpc Votes (QueryVotesRequest) returns (QueryVotesResponse) {} - // Params queries all params + // Params queries all parameters of the gov module rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {} // Deposit queries single deposit information based proposalID, depositAddr diff --git a/proto/cosmos/params/query.proto b/proto/cosmos/params/query.proto index a4b999b7d8..cda23d050a 100644 --- a/proto/cosmos/params/query.proto +++ b/proto/cosmos/params/query.proto @@ -8,18 +8,18 @@ option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; // Query creates service with Parameters as rpc service Query{ - // Parameters queries all params - rpc Parameters (QueryParametersRequest) returns (QueryParametersResponse) {} + // Params queries all parameters of the params module + rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {} } -// QueryParametersRequest is request type for the Query/Parameters RPC method -message QueryParametersRequest{ +// QueryParamsRequest is request type for the Query/Params RPC method +message QueryParamsRequest{ string subspace = 1; string key = 2; } -// QueryParametersResponse is response type for the Query/Parameters RPC method -message QueryParametersResponse{ +// QueryParamsResponse is response type for the Query/Params RPC method +message QueryParamsResponse{ cosmos.params.ParamChange params = 1 [(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/slashing/query.proto b/proto/cosmos/slashing/query.proto index f61a78d0a4..7c54c246c4 100644 --- a/proto/cosmos/slashing/query.proto +++ b/proto/cosmos/slashing/query.proto @@ -19,10 +19,10 @@ service Query { rpc SigningInfos (QuerySigningInfosRequest) returns (QuerySigningInfosResponse) {} } -// QueryParamsRequest is the request type for the Query/Parameters RPC method +// QueryParamsRequest is the request type for the Query/Params RPC method message QueryParamsRequest{} -// QueryParamsResponse is the response type for the Query/Parameters RPC method +// QueryParamsResponse is the response type for the Query/Params RPC method message QueryParamsResponse{ cosmos.slashing.Params params = 1[(gogoproto.nullable) = false]; } diff --git a/proto/cosmos/staking/query.proto b/proto/cosmos/staking/query.proto index 13619b8cbd..139ff9eb7e 100644 --- a/proto/cosmos/staking/query.proto +++ b/proto/cosmos/staking/query.proto @@ -217,10 +217,10 @@ message QueryPoolResponse { Pool pool = 1 [(gogoproto.nullable) = false]; } -// QueryParametersRequest is request type for the Query/Parameters RPC method +// QueryParamsRequest is request type for the Query/Params RPC method message QueryParamsRequest { } -// QueryParametersResponse is response type for the Query/Parameters RPC method +// QueryParamsResponse is response type for the Query/Params RPC method message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; diff --git a/x/auth/keeper/grpc_query.go b/x/auth/keeper/grpc_query.go index 24a14a1e04..45e16d8a1d 100644 --- a/x/auth/keeper/grpc_query.go +++ b/x/auth/keeper/grpc_query.go @@ -40,15 +40,15 @@ func (k AccountKeeper) Account(c context.Context, req *types.QueryAccountRequest return &types.QueryAccountResponse{Account: acc}, nil } -// Parameters returns parameters of auth module -func (k AccountKeeper) Parameters(c context.Context, req *types.QueryParametersRequest) (*types.QueryParametersResponse, error) { +// Params returns parameters of auth module +func (k AccountKeeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } ctx := sdk.UnwrapSDKContext(c) params := k.GetParams(ctx) - return &types.QueryParametersResponse{Params: params}, nil + return &types.QueryParamsResponse{Params: params}, nil } // ConvertAccount converts AccountI to Any type diff --git a/x/auth/keeper/grpc_query_test.go b/x/auth/keeper/grpc_query_test.go index 465a839374..732535cf10 100644 --- a/x/auth/keeper/grpc_query_test.go +++ b/x/auth/keeper/grpc_query_test.go @@ -94,7 +94,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryAccount() { func (suite *KeeperTestSuite) TestGRPCQueryParameters() { var ( - req *types.QueryParametersRequest + req *types.QueryParamsRequest expParams types.Params ) @@ -106,7 +106,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParameters() { { "success", func() { - req = &types.QueryParametersRequest{} + req = &types.QueryParamsRequest{} expParams = suite.app.AccountKeeper.GetParams(suite.ctx) }, true, @@ -120,7 +120,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParameters() { tc.malleate() ctx := sdk.WrapSDKContext(suite.ctx) - res, err := suite.queryClient.Parameters(ctx, req) + res, err := suite.queryClient.Params(ctx, req) if tc.expPass { suite.Require().NoError(err) diff --git a/x/auth/keeper/querier_test.go b/x/auth/keeper/querier_test.go index 60a762eefc..88ea1a5227 100644 --- a/x/auth/keeper/querier_test.go +++ b/x/auth/keeper/querier_test.go @@ -37,13 +37,13 @@ func TestQueryAccount(t *testing.T) { require.Error(t, err) require.Nil(t, res) - req.Data = cdc.MustMarshalJSON(types.NewQueryAccountRequest([]byte(""))) + req.Data = cdc.MustMarshalJSON(types.QueryAccountRequest{Address: []byte("")}) res, err = querier(ctx, path, req) require.Error(t, err) require.Nil(t, res) _, _, addr := testdata.KeyTestPubAddr() - req.Data = cdc.MustMarshalJSON(types.NewQueryAccountRequest(addr)) + req.Data = cdc.MustMarshalJSON(types.QueryAccountRequest{Address: addr}) res, err = querier(ctx, path, req) require.Error(t, err) require.Nil(t, res) diff --git a/x/auth/types/account_retriever.go b/x/auth/types/account_retriever.go index 07bd5e3347..78a8df6dc9 100644 --- a/x/auth/types/account_retriever.go +++ b/x/auth/types/account_retriever.go @@ -30,7 +30,7 @@ func (ar AccountRetriever) GetAccount(querier client.NodeQuerier, addr sdk.AccAd // height of the query with the account. An error is returned if the query // or decoding fails. func (ar AccountRetriever) GetAccountWithHeight(querier client.NodeQuerier, addr sdk.AccAddress) (AccountI, int64, error) { - bs, err := ar.codec.MarshalJSON(NewQueryAccountRequest(addr)) + bs, err := ar.codec.MarshalJSON(QueryAccountRequest{Address: addr}) if err != nil { return nil, 0, err } diff --git a/x/auth/types/account_retriever_test.go b/x/auth/types/account_retriever_test.go index 9dfe86e0dc..1b3c766013 100644 --- a/x/auth/types/account_retriever_test.go +++ b/x/auth/types/account_retriever_test.go @@ -21,7 +21,7 @@ func TestAccountRetriever(t *testing.T) { mockNodeQuerier := mocks.NewMockNodeQuerier(mockCtrl) accRetr := types.NewAccountRetriever(appCodec) addr := []byte("test") - bs, err := appCodec.MarshalJSON(types.NewQueryAccountRequest(addr)) + bs, err := appCodec.MarshalJSON(types.QueryAccountRequest{Address: addr}) require.NoError(t, err) route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryAccount) diff --git a/x/auth/types/querier.go b/x/auth/types/querier.go index de36109b2c..b643df4a2b 100644 --- a/x/auth/types/querier.go +++ b/x/auth/types/querier.go @@ -1,21 +1,7 @@ package types -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - // query endpoints supported by the auth Querier const ( QueryAccount = "account" QueryParams = "params" ) - -// NewQueryAccountRequest creates a new instance of QueryAccountRequest. -func NewQueryAccountRequest(addr sdk.AccAddress) *QueryAccountRequest { - return &QueryAccountRequest{Address: addr} -} - -// NewQueryParametersRequest creates a new instance of QueryParametersRequest. -func NewQueryParametersRequest() *QueryParametersRequest { - return &QueryParametersRequest{} -} diff --git a/x/auth/types/query.pb.go b/x/auth/types/query.pb.go index 04846ba016..4dd7fe3b87 100644 --- a/x/auth/types/query.pb.go +++ b/x/auth/types/query.pb.go @@ -121,22 +121,22 @@ func (m *QueryAccountResponse) GetAccount() *types.Any { return nil } -// QueryParametersRequest is request type for the Query/Parameters RPC method -type QueryParametersRequest struct { +// QueryParamsRequest is request type for the Query/Params RPC method +type QueryParamsRequest struct { } -func (m *QueryParametersRequest) Reset() { *m = QueryParametersRequest{} } -func (m *QueryParametersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParametersRequest) ProtoMessage() {} -func (*QueryParametersRequest) Descriptor() ([]byte, []int) { +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_e1bc52f4cb65abdb, []int{2} } -func (m *QueryParametersRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParametersRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -146,35 +146,35 @@ func (m *QueryParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryParametersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParametersRequest.Merge(m, src) +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) } -func (m *QueryParametersRequest) XXX_Size() int { +func (m *QueryParamsRequest) XXX_Size() int { return m.Size() } -func (m *QueryParametersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParametersRequest.DiscardUnknown(m) +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryParametersRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParametersResponse is response type for the Query/Parameters RPC method -type QueryParametersResponse struct { +// QueryParamsResponse is response type for the Query/Params RPC method +type QueryParamsResponse struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } -func (m *QueryParametersResponse) Reset() { *m = QueryParametersResponse{} } -func (m *QueryParametersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParametersResponse) ProtoMessage() {} -func (*QueryParametersResponse) Descriptor() ([]byte, []int) { +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_e1bc52f4cb65abdb, []int{3} } -func (m *QueryParametersResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParametersResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -184,19 +184,19 @@ func (m *QueryParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryParametersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParametersResponse.Merge(m, src) +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) } -func (m *QueryParametersResponse) XXX_Size() int { +func (m *QueryParamsResponse) XXX_Size() int { return m.Size() } -func (m *QueryParametersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParametersResponse.DiscardUnknown(m) +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryParametersResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParametersResponse) GetParams() Params { +func (m *QueryParamsResponse) GetParams() Params { if m != nil { return m.Params } @@ -206,38 +206,37 @@ func (m *QueryParametersResponse) GetParams() Params { func init() { proto.RegisterType((*QueryAccountRequest)(nil), "cosmos.auth.QueryAccountRequest") proto.RegisterType((*QueryAccountResponse)(nil), "cosmos.auth.QueryAccountResponse") - proto.RegisterType((*QueryParametersRequest)(nil), "cosmos.auth.QueryParametersRequest") - proto.RegisterType((*QueryParametersResponse)(nil), "cosmos.auth.QueryParametersResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.auth.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.auth.QueryParamsResponse") } func init() { proto.RegisterFile("cosmos/auth/query.proto", fileDescriptor_e1bc52f4cb65abdb) } var fileDescriptor_e1bc52f4cb65abdb = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xc1, 0x4e, 0xf2, 0x40, - 0x10, 0xc7, 0xdb, 0xe4, 0xfb, 0xc0, 0x2c, 0x9c, 0x16, 0x02, 0xd8, 0x43, 0xc1, 0xea, 0x41, 0x0f, - 0x6c, 0x03, 0x5e, 0xbd, 0xb4, 0x9e, 0x8c, 0x1e, 0xb0, 0xf1, 0xa2, 0x17, 0xd3, 0x96, 0xb5, 0x18, - 0xa5, 0x5b, 0x3a, 0xdb, 0x44, 0xde, 0xc2, 0x87, 0xe1, 0x21, 0x88, 0x27, 0x8e, 0x9e, 0x88, 0x81, - 0xb7, 0xf0, 0x64, 0xba, 0xbb, 0x8d, 0x10, 0x0c, 0x97, 0xb6, 0x3b, 0x33, 0xbf, 0xff, 0x7f, 0x66, - 0xa7, 0xa8, 0x19, 0x32, 0x18, 0x33, 0xb0, 0xfd, 0x8c, 0x8f, 0xec, 0x49, 0x46, 0xd3, 0x29, 0x49, - 0x52, 0xc6, 0x19, 0xae, 0xc8, 0x04, 0xc9, 0x13, 0x46, 0x3d, 0x62, 0x11, 0x13, 0x71, 0x3b, 0xff, - 0x92, 0x25, 0xc6, 0x61, 0xc4, 0x58, 0xf4, 0x4a, 0x6d, 0x71, 0x0a, 0xb2, 0x27, 0xdb, 0x8f, 0x15, - 0x6d, 0x34, 0x36, 0x65, 0xf3, 0x47, 0x81, 0xc8, 0xf8, 0xa3, 0xd4, 0x52, 0x16, 0xe2, 0x60, 0x05, - 0xa8, 0x76, 0x9b, 0xfb, 0x3b, 0x61, 0xc8, 0xb2, 0x98, 0x7b, 0x74, 0x92, 0x51, 0xe0, 0xf8, 0x1a, - 0x95, 0xfd, 0xe1, 0x30, 0xa5, 0x00, 0x2d, 0xbd, 0xa3, 0x9f, 0x56, 0xdd, 0xde, 0xf7, 0xb2, 0xdd, - 0x8d, 0x9e, 0xf9, 0x28, 0x0b, 0x48, 0xc8, 0xc6, 0x4a, 0x44, 0xbd, 0xba, 0x30, 0x7c, 0xb1, 0xf9, - 0x34, 0xa1, 0x40, 0x9c, 0x30, 0x74, 0x24, 0xe8, 0x15, 0x0a, 0xd6, 0x1d, 0xaa, 0x6f, 0x7b, 0x40, - 0xc2, 0x62, 0xa0, 0xf8, 0x02, 0x95, 0x7d, 0x19, 0x12, 0x26, 0x95, 0x7e, 0x9d, 0xc8, 0xd9, 0x48, - 0x31, 0x1b, 0x71, 0xe2, 0xa9, 0x5b, 0xfd, 0x98, 0x75, 0x0f, 0x14, 0x7b, 0xe5, 0x15, 0x88, 0xd5, - 0x42, 0x0d, 0xa1, 0x3a, 0xf0, 0x53, 0x7f, 0x4c, 0x39, 0x4d, 0x41, 0x35, 0x6f, 0xdd, 0xa0, 0xe6, - 0x4e, 0x46, 0x59, 0xf6, 0x50, 0x29, 0xc9, 0xa3, 0xa0, 0x1c, 0x6b, 0x64, 0xe3, 0xc2, 0x89, 0x00, - 0xc0, 0xfd, 0x37, 0x5f, 0xb6, 0x35, 0x4f, 0x15, 0xf6, 0x67, 0x3a, 0xfa, 0x2f, 0xe4, 0xf0, 0x00, - 0x95, 0x55, 0x1b, 0xb8, 0xb3, 0xc5, 0xfd, 0x71, 0x83, 0xc6, 0xd1, 0x9e, 0x0a, 0xd9, 0x8c, 0xa5, - 0xe1, 0x7b, 0x84, 0x7e, 0x9b, 0xc4, 0xc7, 0xbb, 0xc8, 0xce, 0x70, 0xc6, 0xc9, 0xfe, 0xa2, 0x42, - 0xda, 0xbd, 0x9c, 0xaf, 0x4c, 0x7d, 0xb1, 0x32, 0xf5, 0xaf, 0x95, 0xa9, 0xbf, 0xaf, 0x4d, 0x6d, - 0xb1, 0x36, 0xb5, 0xcf, 0xb5, 0xa9, 0x3d, 0x9c, 0xed, 0x5d, 0xe3, 0x9b, 0xfc, 0x7b, 0xc4, 0x36, - 0x83, 0x92, 0x58, 0xc4, 0xf9, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x04, 0xbe, 0xe5, 0xa3, 0xb0, - 0x02, 0x00, 0x00, + // 364 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0xbb, 0x4e, 0xf3, 0x30, + 0x18, 0x4d, 0xa4, 0xff, 0x6f, 0x91, 0xdb, 0xc9, 0x8d, 0xb8, 0x64, 0x48, 0x4b, 0x26, 0x18, 0xea, + 0xa8, 0x65, 0x65, 0x49, 0x58, 0x40, 0x08, 0xa9, 0x44, 0x4c, 0x2c, 0x28, 0x71, 0x4d, 0x8a, 0xa0, + 0x71, 0x1a, 0xdb, 0x12, 0x7d, 0x0b, 0x1e, 0x83, 0x07, 0xe0, 0x21, 0x2a, 0xa6, 0x8e, 0x4c, 0x15, + 0x6a, 0xdf, 0x82, 0x09, 0xc5, 0x17, 0xa9, 0x15, 0xd0, 0x25, 0x89, 0x8f, 0xcf, 0xc5, 0xe7, 0x73, + 0xc0, 0x1e, 0xa6, 0x6c, 0x4c, 0x59, 0x90, 0x08, 0x3e, 0x0a, 0x26, 0x82, 0x94, 0x53, 0x54, 0x94, + 0x94, 0x53, 0xd8, 0x50, 0x1b, 0xa8, 0xda, 0x70, 0x9d, 0x8c, 0x66, 0x54, 0xe2, 0x41, 0xf5, 0xa5, + 0x28, 0xee, 0x41, 0x46, 0x69, 0xf6, 0x44, 0x02, 0xb9, 0x4a, 0xc5, 0x7d, 0x90, 0xe4, 0x5a, 0xed, + 0xee, 0xae, 0xdb, 0x56, 0x0f, 0x23, 0x51, 0xf8, 0x9d, 0xf2, 0xd2, 0x11, 0x72, 0xe1, 0xa7, 0xa0, + 0x75, 0x5d, 0xe5, 0x87, 0x18, 0x53, 0x91, 0xf3, 0x98, 0x4c, 0x04, 0x61, 0x1c, 0x5e, 0x82, 0x7a, + 0x32, 0x1c, 0x96, 0x84, 0xb1, 0x7d, 0xbb, 0x63, 0x1f, 0x35, 0xa3, 0xde, 0xd7, 0xa2, 0xdd, 0xcd, + 0x1e, 0xf8, 0x48, 0xa4, 0x08, 0xd3, 0xb1, 0x36, 0xd1, 0xaf, 0x2e, 0x1b, 0x3e, 0x06, 0x7c, 0x5a, + 0x10, 0x86, 0x42, 0x8c, 0x43, 0x25, 0x8c, 0x8d, 0x83, 0x7f, 0x03, 0x9c, 0xcd, 0x0c, 0x56, 0xd0, + 0x9c, 0x11, 0x78, 0x0a, 0xea, 0x89, 0x82, 0x64, 0x48, 0xa3, 0xef, 0x20, 0xd5, 0x0d, 0x99, 0x6e, + 0x28, 0xcc, 0xa7, 0x51, 0xf3, 0xfd, 0xad, 0xbb, 0xa3, 0xb5, 0x17, 0xb1, 0x91, 0xf8, 0x0e, 0x80, + 0xd2, 0x75, 0x90, 0x94, 0xc9, 0x98, 0xe9, 0x83, 0xfb, 0xe7, 0xba, 0x8f, 0x41, 0x75, 0x54, 0x0f, + 0xd4, 0x0a, 0x89, 0xe8, 0xa4, 0x16, 0x5a, 0x1b, 0x34, 0x52, 0xe4, 0xe8, 0xdf, 0x6c, 0xd1, 0xb6, + 0x62, 0x4d, 0xec, 0xbf, 0xda, 0xe0, 0xbf, 0xb4, 0x82, 0x03, 0x50, 0xd7, 0xf1, 0xb0, 0xb3, 0xa1, + 0xfb, 0x65, 0x72, 0xee, 0xe1, 0x16, 0x86, 0x3a, 0x8c, 0x6f, 0xc1, 0x2b, 0x50, 0x53, 0x99, 0xb0, + 0xfd, 0x93, 0xbe, 0x51, 0xc8, 0xed, 0xfc, 0x4d, 0x30, 0x76, 0xd1, 0xd9, 0x6c, 0xe9, 0xd9, 0xf3, + 0xa5, 0x67, 0x7f, 0x2e, 0x3d, 0xfb, 0x65, 0xe5, 0x59, 0xf3, 0x95, 0x67, 0x7d, 0xac, 0x3c, 0xeb, + 0xf6, 0x78, 0xeb, 0x95, 0x3d, 0xab, 0x3f, 0x45, 0xde, 0x5c, 0x5a, 0x93, 0x43, 0x3f, 0xf9, 0x0e, + 0x00, 0x00, 0xff, 0xff, 0xf2, 0xf9, 0x5a, 0x33, 0x9c, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -254,8 +253,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Account returns account details based on address Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error) - // Parameters queries all params - Parameters(ctx context.Context, in *QueryParametersRequest, opts ...grpc.CallOption) (*QueryParametersResponse, error) + // Params queries all parameters + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } type queryClient struct { @@ -275,9 +274,9 @@ func (c *queryClient) Account(ctx context.Context, in *QueryAccountRequest, opts return out, nil } -func (c *queryClient) Parameters(ctx context.Context, in *QueryParametersRequest, opts ...grpc.CallOption) (*QueryParametersResponse, error) { - out := new(QueryParametersResponse) - err := c.cc.Invoke(ctx, "/cosmos.auth.Query/Parameters", in, out, opts...) +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.auth.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -288,8 +287,8 @@ func (c *queryClient) Parameters(ctx context.Context, in *QueryParametersRequest type QueryServer interface { // Account returns account details based on address Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error) - // Parameters queries all params - Parameters(context.Context, *QueryParametersRequest) (*QueryParametersResponse, error) + // Params queries all parameters + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -299,8 +298,8 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) Account(ctx context.Context, req *QueryAccountRequest) (*QueryAccountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Account not implemented") } -func (*UnimplementedQueryServer) Parameters(ctx context.Context, req *QueryParametersRequest) (*QueryParametersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Parameters not implemented") +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { @@ -325,20 +324,20 @@ func _Query_Account_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } -func _Query_Parameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParametersRequest) +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Parameters(ctx, in) + return srv.(QueryServer).Params(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.auth.Query/Parameters", + FullMethod: "/cosmos.auth.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Parameters(ctx, req.(*QueryParametersRequest)) + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) } return interceptor(ctx, in, info, handler) } @@ -352,8 +351,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Account_Handler, }, { - MethodName: "Parameters", - Handler: _Query_Parameters_Handler, + MethodName: "Params", + Handler: _Query_Params_Handler, }, }, Streams: []grpc.StreamDesc{}, @@ -425,7 +424,7 @@ func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryParametersRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -435,12 +434,12 @@ func (m *QueryParametersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParametersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -448,7 +447,7 @@ func (m *QueryParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryParametersResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -458,12 +457,12 @@ func (m *QueryParametersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParametersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -518,7 +517,7 @@ func (m *QueryAccountResponse) Size() (n int) { return n } -func (m *QueryParametersRequest) Size() (n int) { +func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 } @@ -527,7 +526,7 @@ func (m *QueryParametersRequest) Size() (n int) { return n } -func (m *QueryParametersResponse) Size() (n int) { +func (m *QueryParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -720,7 +719,7 @@ func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -743,10 +742,10 @@ func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParametersRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParametersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -773,7 +772,7 @@ func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParametersResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -796,10 +795,10 @@ func (m *QueryParametersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParametersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/gov/types/query.pb.go b/x/gov/types/query.pb.go index 346eeffdf3..4de0c9faaa 100644 --- a/x/gov/types/query.pb.go +++ b/x/gov/types/query.pb.go @@ -953,7 +953,7 @@ type QueryClient interface { Vote(ctx context.Context, in *QueryVoteRequest, opts ...grpc.CallOption) (*QueryVoteResponse, error) // Votes queries votes of a given proposal Votes(ctx context.Context, in *QueryVotesRequest, opts ...grpc.CallOption) (*QueryVotesResponse, error) - // Params queries all params + // Params queries all parameters of the gov module Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) // Deposit queries single deposit information based proposalID, depositAddr Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) @@ -1053,7 +1053,7 @@ type QueryServer interface { Vote(context.Context, *QueryVoteRequest) (*QueryVoteResponse, error) // Votes queries votes of a given proposal Votes(context.Context, *QueryVotesRequest) (*QueryVotesResponse, error) - // Params queries all params + // Params queries all parameters of the gov module Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) // Deposit queries single deposit information based proposalID, depositAddr Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) diff --git a/x/params/client/cli/query.go b/x/params/client/cli/query.go index b9c4b24d17..0da586a036 100644 --- a/x/params/client/cli/query.go +++ b/x/params/client/cli/query.go @@ -41,8 +41,8 @@ func NewQuerySubspaceParamsCmd() *cobra.Command { } queryClient := proposal.NewQueryClient(clientCtx) - params := proposal.NewQueryParametersRequest(args[0], args[1]) - res, err := queryClient.Parameters(context.Background(), params) + params := proposal.QueryParamsRequest{Subspace: args[0], Key: args[1]} + res, err := queryClient.Params(context.Background(), ¶ms) if err != nil { return err } diff --git a/x/params/keeper/grpc_query.go b/x/params/keeper/grpc_query.go index 662bf9575b..392b87a65d 100644 --- a/x/params/keeper/grpc_query.go +++ b/x/params/keeper/grpc_query.go @@ -13,8 +13,8 @@ import ( var _ proposal.QueryServer = Keeper{} -// Parameters returns subspace params -func (k Keeper) Parameters(c context.Context, req *proposal.QueryParametersRequest) (*proposal.QueryParametersResponse, error) { +// Params returns subspace params +func (k Keeper) Params(c context.Context, req *proposal.QueryParamsRequest) (*proposal.QueryParamsResponse, error) { if req == nil { return nil, status.Errorf(codes.InvalidArgument, "empty request") } @@ -32,5 +32,5 @@ func (k Keeper) Parameters(c context.Context, req *proposal.QueryParametersReque rawValue := ss.GetRaw(ctx, []byte(req.Key)) params := proposal.NewParamChange(req.Subspace, req.Key, string(rawValue)) - return &proposal.QueryParametersResponse{Params: params}, nil + return &proposal.QueryParamsResponse{Params: params}, nil } diff --git a/x/params/keeper/grpc_query_test.go b/x/params/keeper/grpc_query_test.go index e82a31c43a..437ffe1f5b 100644 --- a/x/params/keeper/grpc_query_test.go +++ b/x/params/keeper/grpc_query_test.go @@ -10,7 +10,7 @@ import ( func (suite *KeeperTestSuite) TestGRPCQueryParams() { var ( - req *proposal.QueryParametersRequest + req *proposal.QueryParamsRequest expValue string space types.Subspace ) @@ -24,21 +24,21 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { { "empty request", func() { - req = &proposal.QueryParametersRequest{} + req = &proposal.QueryParamsRequest{} }, false, }, { "invalid request with subspace not found", func() { - req = &proposal.QueryParametersRequest{Subspace: "test"} + req = &proposal.QueryParamsRequest{Subspace: "test"} }, false, }, { "invalid request with subspace and key not found", func() { - req = &proposal.QueryParametersRequest{Subspace: "test", Key: "key"} + req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} }, false, }, @@ -47,7 +47,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { space = suite.app.ParamsKeeper.Subspace("test"). WithKeyTable(types.NewKeyTable(types.NewParamSetPair(key, paramJSON{}, validateNoOp))) - req = &proposal.QueryParametersRequest{Subspace: "test", Key: "key"} + req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} expValue = "" }, true, @@ -57,7 +57,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { func() { err := space.Update(suite.ctx, key, []byte(`{"param1":"10241024"}`)) suite.Require().NoError(err) - req = &proposal.QueryParametersRequest{Subspace: "test", Key: "key"} + req = &proposal.QueryParamsRequest{Subspace: "test", Key: "key"} expValue = `{"param1":"10241024"}` }, true, @@ -71,7 +71,7 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { tc.malleate() - res, err := suite.queryClient.Parameters(ctx, req) + res, err := suite.queryClient.Params(ctx, req) if tc.expPass { suite.Require().NoError(err) diff --git a/x/params/types/proposal/proposal.go b/x/params/types/proposal/proposal.go index a291a17fc5..4480795789 100644 --- a/x/params/types/proposal/proposal.go +++ b/x/params/types/proposal/proposal.go @@ -100,11 +100,3 @@ func ValidateChanges(changes []ParamChange) error { return nil } - -// NewQueryParametersRequest returns the new instance of QueryParametersRequest -func NewQueryParametersRequest(ss, key string) *QueryParametersRequest { - return &QueryParametersRequest{ - Subspace: ss, - Key: key, - } -} diff --git a/x/params/types/proposal/query.pb.go b/x/params/types/proposal/query.pb.go index 61797d7a30..915aa098f1 100644 --- a/x/params/types/proposal/query.pb.go +++ b/x/params/types/proposal/query.pb.go @@ -28,24 +28,24 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParametersRequest is request type for the Query/Parameters RPC method -type QueryParametersRequest struct { +// QueryParamsRequest is request type for the Query/Params RPC method +type QueryParamsRequest struct { Subspace string `protobuf:"bytes,1,opt,name=subspace,proto3" json:"subspace,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` } -func (m *QueryParametersRequest) Reset() { *m = QueryParametersRequest{} } -func (m *QueryParametersRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParametersRequest) ProtoMessage() {} -func (*QueryParametersRequest) Descriptor() ([]byte, []int) { +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return fileDescriptor_3bc356506c43c13a, []int{0} } -func (m *QueryParametersRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParametersRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,49 +55,49 @@ func (m *QueryParametersRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryParametersRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParametersRequest.Merge(m, src) +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) } -func (m *QueryParametersRequest) XXX_Size() int { +func (m *QueryParamsRequest) XXX_Size() int { return m.Size() } -func (m *QueryParametersRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParametersRequest.DiscardUnknown(m) +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) } -var xxx_messageInfo_QueryParametersRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -func (m *QueryParametersRequest) GetSubspace() string { +func (m *QueryParamsRequest) GetSubspace() string { if m != nil { return m.Subspace } return "" } -func (m *QueryParametersRequest) GetKey() string { +func (m *QueryParamsRequest) GetKey() string { if m != nil { return m.Key } return "" } -// QueryParametersResponse is response type for the Query/Parameters RPC method -type QueryParametersResponse struct { +// QueryParamsResponse is response type for the Query/Params RPC method +type QueryParamsResponse struct { Params ParamChange `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } -func (m *QueryParametersResponse) Reset() { *m = QueryParametersResponse{} } -func (m *QueryParametersResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParametersResponse) ProtoMessage() {} -func (*QueryParametersResponse) Descriptor() ([]byte, []int) { +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { return fileDescriptor_3bc356506c43c13a, []int{1} } -func (m *QueryParametersResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParametersResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -107,19 +107,19 @@ func (m *QueryParametersResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryParametersResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParametersResponse.Merge(m, src) +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) } -func (m *QueryParametersResponse) XXX_Size() int { +func (m *QueryParamsResponse) XXX_Size() int { return m.Size() } -func (m *QueryParametersResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParametersResponse.DiscardUnknown(m) +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryParametersResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParametersResponse) GetParams() ParamChange { +func (m *QueryParamsResponse) GetParams() ParamChange { if m != nil { return m.Params } @@ -127,32 +127,32 @@ func (m *QueryParametersResponse) GetParams() ParamChange { } func init() { - proto.RegisterType((*QueryParametersRequest)(nil), "cosmos.params.QueryParametersRequest") - proto.RegisterType((*QueryParametersResponse)(nil), "cosmos.params.QueryParametersResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmos.params.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmos.params.QueryParamsResponse") } func init() { proto.RegisterFile("cosmos/params/query.proto", fileDescriptor_3bc356506c43c13a) } var fileDescriptor_3bc356506c43c13a = []byte{ - // 278 bytes of a gzipped FileDescriptorProto + // 273 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4c, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x85, 0x48, 0xe9, 0x41, 0xa4, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x32, 0xfa, 0x20, 0x16, 0x44, 0x91, 0x94, 0x14, 0xaa, 0x7e, 0x08, 0x05, 0x91, - 0x53, 0x72, 0xe3, 0x12, 0x0b, 0x04, 0x99, 0x17, 0x00, 0x12, 0x4c, 0x2d, 0x49, 0x2d, 0x2a, 0x0e, - 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x11, 0x92, 0xe2, 0xe2, 0x28, 0x2e, 0x4d, 0x2a, 0x2e, 0x48, - 0x4c, 0x4e, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf3, 0x85, 0x04, 0xb8, 0x98, 0xb3, - 0x53, 0x2b, 0x25, 0x98, 0xc0, 0xc2, 0x20, 0xa6, 0x52, 0x30, 0x97, 0x38, 0x86, 0x39, 0xc5, 0x05, - 0xf9, 0x79, 0xc5, 0xa9, 0x42, 0x16, 0x5c, 0x6c, 0x10, 0x2b, 0xc1, 0xc6, 0x70, 0x1b, 0x49, 0xe9, - 0xa1, 0x38, 0x5a, 0x0f, 0xac, 0xc5, 0x39, 0x23, 0x31, 0x2f, 0x3d, 0xd5, 0x89, 0xe5, 0xc4, 0x3d, - 0x79, 0x86, 0x20, 0xa8, 0x7a, 0xa3, 0x34, 0x2e, 0x56, 0xb0, 0xa1, 0x42, 0xb1, 0x5c, 0x5c, 0x08, - 0x83, 0x85, 0x54, 0xd1, 0x0c, 0xc0, 0xee, 0x01, 0x29, 0x35, 0x42, 0xca, 0x20, 0xee, 0x53, 0x62, - 0x70, 0xf2, 0x3b, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, - 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x93, 0xf4, 0xcc, - 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x68, 0x28, 0x42, 0x28, 0xdd, 0xe2, 0x94, - 0x6c, 0xfd, 0x0a, 0x58, 0x90, 0x96, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x17, 0x14, 0xe5, 0x17, 0xe4, - 0x17, 0x27, 0xe6, 0x24, 0xb1, 0x81, 0xc3, 0xd6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xc1, - 0xb2, 0x34, 0xb9, 0x01, 0x00, 0x00, + 0x53, 0x72, 0xe2, 0x12, 0x0a, 0x04, 0x99, 0x17, 0x00, 0x16, 0x0c, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, + 0x2e, 0x11, 0x92, 0xe2, 0xe2, 0x28, 0x2e, 0x4d, 0x2a, 0x2e, 0x48, 0x4c, 0x4e, 0x95, 0x60, 0x54, + 0x60, 0xd4, 0xe0, 0x0c, 0x82, 0xf3, 0x85, 0x04, 0xb8, 0x98, 0xb3, 0x53, 0x2b, 0x25, 0x98, 0xc0, + 0xc2, 0x20, 0xa6, 0x92, 0x3f, 0x97, 0x30, 0x8a, 0x19, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x42, + 0x16, 0x5c, 0x6c, 0x10, 0xab, 0xc0, 0x46, 0x70, 0x1b, 0x49, 0xe9, 0xa1, 0x38, 0x56, 0x0f, 0xac, + 0xdc, 0x39, 0x23, 0x31, 0x2f, 0x3d, 0xd5, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0xa8, 0x7a, + 0xa3, 0x28, 0x2e, 0x56, 0xb0, 0x81, 0x42, 0x81, 0x5c, 0x6c, 0x10, 0x43, 0x85, 0x14, 0xd1, 0x34, + 0x63, 0x3a, 0x5a, 0x4a, 0x09, 0x9f, 0x12, 0x88, 0x9b, 0x94, 0x18, 0x9c, 0xfc, 0x4e, 0x3c, 0x92, + 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, + 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0xca, 0x24, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, + 0x39, 0x3f, 0x57, 0x1f, 0x1a, 0x62, 0x10, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0x02, 0x16, 0x7c, + 0x25, 0x95, 0x05, 0xa9, 0xc5, 0xfa, 0x05, 0x45, 0xf9, 0x05, 0xf9, 0xc5, 0x89, 0x39, 0x49, 0x6c, + 0xe0, 0x70, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x88, 0x12, 0x84, 0xa6, 0xa5, 0x01, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -167,8 +167,8 @@ const _ = grpc.SupportPackageIsVersion4 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryClient interface { - // Parameters queries all params - Parameters(ctx context.Context, in *QueryParametersRequest, opts ...grpc.CallOption) (*QueryParametersResponse, error) + // Params queries all parameters of the params module + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } type queryClient struct { @@ -179,9 +179,9 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Parameters(ctx context.Context, in *QueryParametersRequest, opts ...grpc.CallOption) (*QueryParametersResponse, error) { - out := new(QueryParametersResponse) - err := c.cc.Invoke(ctx, "/cosmos.params.Query/Parameters", in, out, opts...) +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmos.params.Query/Params", in, out, opts...) if err != nil { return nil, err } @@ -190,36 +190,36 @@ func (c *queryClient) Parameters(ctx context.Context, in *QueryParametersRequest // QueryServer is the server API for Query service. type QueryServer interface { - // Parameters queries all params - Parameters(context.Context, *QueryParametersRequest) (*QueryParametersResponse, error) + // Params queries all parameters of the params module + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Parameters(ctx context.Context, req *QueryParametersRequest) (*QueryParametersResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Parameters not implemented") +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Parameters_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParametersRequest) +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Parameters(ctx, in) + return srv.(QueryServer).Params(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/cosmos.params.Query/Parameters", + FullMethod: "/cosmos.params.Query/Params", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Parameters(ctx, req.(*QueryParametersRequest)) + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) } return interceptor(ctx, in, info, handler) } @@ -229,15 +229,15 @@ var _Query_serviceDesc = grpc.ServiceDesc{ HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Parameters", - Handler: _Query_Parameters_Handler, + MethodName: "Params", + Handler: _Query_Params_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/params/query.proto", } -func (m *QueryParametersRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -247,12 +247,12 @@ func (m *QueryParametersRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParametersRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -274,7 +274,7 @@ func (m *QueryParametersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryParametersResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -284,12 +284,12 @@ func (m *QueryParametersResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParametersResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParametersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -318,7 +318,7 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryParametersRequest) Size() (n int) { +func (m *QueryParamsRequest) Size() (n int) { if m == nil { return 0 } @@ -335,7 +335,7 @@ func (m *QueryParametersRequest) Size() (n int) { return n } -func (m *QueryParametersResponse) Size() (n int) { +func (m *QueryParamsResponse) Size() (n int) { if m == nil { return 0 } @@ -352,7 +352,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -375,10 +375,10 @@ func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParametersRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParametersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -469,7 +469,7 @@ func (m *QueryParametersRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParametersResponse) Unmarshal(dAtA []byte) error { +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -492,10 +492,10 @@ func (m *QueryParametersResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParametersResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParametersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/slashing/types/query.pb.go b/x/slashing/types/query.pb.go index d8883d3a99..7135b308e6 100644 --- a/x/slashing/types/query.pb.go +++ b/x/slashing/types/query.pb.go @@ -30,7 +30,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is the request type for the Query/Parameters RPC method +// QueryParamsRequest is the request type for the Query/Params RPC method type QueryParamsRequest struct { } @@ -67,7 +67,7 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParamsResponse is the response type for the Query/Parameters RPC method +// QueryParamsResponse is the response type for the Query/Params RPC method type QueryParamsResponse struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } diff --git a/x/staking/types/query.pb.go b/x/staking/types/query.pb.go index 73cdfc5a86..0637be19ca 100644 --- a/x/staking/types/query.pb.go +++ b/x/staking/types/query.pb.go @@ -1360,7 +1360,7 @@ func (m *QueryPoolResponse) GetPool() Pool { return Pool{} } -// QueryParametersRequest is request type for the Query/Parameters RPC method +// QueryParamsRequest is request type for the Query/Params RPC method type QueryParamsRequest struct { } @@ -1397,7 +1397,7 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo -// QueryParametersResponse is response type for the Query/Parameters RPC method +// QueryParamsResponse is response type for the Query/Params RPC method type QueryParamsResponse struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`