Skip to content

Commit

Permalink
Rename proto Req/Res to Pagination (cosmos#6796)
Browse files Browse the repository at this point in the history
* Rename proto Req to Pagination

* Change Res to Pagination

Co-authored-by: Alexander Bezobchuk <alexanderbez@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 20, 2020
1 parent 515b25b commit 69bbb8b
Show file tree
Hide file tree
Showing 51 changed files with 1,564 additions and 1,562 deletions.
4 changes: 2 additions & 2 deletions proto/cosmos/bank/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ message QueryAllBalancesRequest {
// address is the address to query balances for
bytes address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC method
Expand All @@ -51,7 +51,7 @@ message QueryAllBalancesResponse {
repeated cosmos.Coin balances = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC method
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/distribution/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ message QueryValidatorSlashesRequest {
bytes validator_address = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];
uint64 starting_height = 2;
uint64 ending_height = 3;
cosmos.query.PageRequest req = 4;
cosmos.query.PageRequest pagination = 4;
}

// QueryValidatorSlashesResponse is the response type for the Query/ValidatorSlashes RPC method
message QueryValidatorSlashesResponse {
repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryDelegationRewardsRequest is the request type for the Query/DelegationRewards RPC method
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/evidence/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ message QueryEvidenceResponse {

// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC method
message QueryAllEvidenceRequest {
cosmos.query.PageRequest req = 1;
cosmos.query.PageRequest pagination = 1;
}

// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC method
message QueryAllEvidenceResponse {
repeated google.protobuf.Any evidence = 1;

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}
12 changes: 6 additions & 6 deletions proto/cosmos/gov/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ message QueryProposalsRequest {
// Deposit addresses from the proposals.
bytes depositor = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 4;
cosmos.query.PageRequest pagination = 4;
}

// QueryProposalsResponse is the response type for the Query/Proposals RPC method
message QueryProposalsResponse {
repeated Proposal proposals = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryVoteRequest is the request type for the Query/Vote RPC method
Expand All @@ -85,14 +85,14 @@ message QueryVotesRequest {
// unique id of the proposal
uint64 proposal_id = 1;

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryVotesResponse is the response type for the Query/Votes RPC method
message QueryVotesResponse {
repeated Vote votes = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryParamsRequest is the request type for the Query/Params RPC method
Expand Down Expand Up @@ -126,14 +126,14 @@ message QueryDepositsRequest {
// unique id of the proposal
uint64 proposal_id = 1;

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryDepositsResponse is the response type for the Query/Deposits RPC method
message QueryDepositsResponse {
repeated Deposit deposits = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryTallyResultRequest is the request type for the Query/Tally RPC method
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/query/pagination.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ option go_package = "github.com/cosmos/cosmos-sdk/types/query";
//
// message SomeRequest {
// Foo some_parameter = 1;
// PageRequest page = 2;
// PageRequest pagination = 2;
// }
message PageRequest {
// key is a value returned in PageResponse.next_key to begin
Expand Down
4 changes: 2 additions & 2 deletions proto/cosmos/slashing/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ message QuerySigningInfoResponse{

// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC method
message QuerySigningInfosRequest{
cosmos.query.PageRequest req = 1;
cosmos.query.PageRequest pagination = 1;
}

// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC method
message QuerySigningInfosResponse{
// info is the signing info of all validators
repeated cosmos.slashing.ValidatorSigningInfo info = 1[(gogoproto.nullable)= false];
cosmos.query.PageResponse res =2;
cosmos.query.PageResponse pagination =2;
}
30 changes: 15 additions & 15 deletions proto/cosmos/staking/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ service Query {
message QueryValidatorsRequest{
string status = 1;

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryValidatorsResponse is response type for the Query/Validators RPC method
message QueryValidatorsResponse {
repeated cosmos.staking.Validator validators = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryValidatorRequest is response type for the Query/Validator RPC method
Expand All @@ -80,28 +80,28 @@ message QueryValidatorResponse {
message QueryValidatorDelegationsRequest {
bytes validator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryValidatorDelegationsRequest is response type for the Query/ValidatorDelegations RPC method
message QueryValidatorDelegationsResponse {
repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryValidatorUnbondingDelegationsRequest is required type for the Query/ValidatorUnbondingDelegations RPC method
message QueryValidatorUnbondingDelegationsRequest {
bytes validator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryValidatorUnbondingDelegationsResponse is response type for the Query/ValidatorUnbondingDelegations RPC method
message QueryValidatorUnbondingDelegationsResponse {
repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryDelegationRequest is request type for the Query/Delegation RPC method
Expand Down Expand Up @@ -132,27 +132,27 @@ message QueryUnbondingDelegationResponse {
message QueryDelegatorDelegationsRequest {
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryDelegatorDelegationsResponse is response type for the Query/DelegatorDelegations RPC method
message QueryDelegatorDelegationsResponse {
repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryDelegatorUnbondingDelegationsRequest is request type for the Query/DelegatorUnbondingDelegations RPC method
message QueryDelegatorUnbondingDelegationsRequest {
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}
// QueryUnbondingDelegatorDelegationsResponse is response type for the Query/UnbondingDelegatorDelegations RPC method
message QueryDelegatorUnbondingDelegationsResponse {
repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryRedelegationsRequest is request type for the Query/Redelegations RPC method
Expand All @@ -163,28 +163,28 @@ message QueryRedelegationsRequest {

bytes dst_validator_addr = 3 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress"];

cosmos.query.PageRequest req = 4;
cosmos.query.PageRequest pagination = 4;
}

// QueryRedelegationsResponse is response type for the Query/Redelegations RPC method
message QueryRedelegationsResponse {
repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryDelegatorValidatorsRequest is request type for the Query/DelegatorValidators RPC method
message QueryDelegatorValidatorsRequest {
bytes delegator_addr = 1 [(gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.AccAddress"];

cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryDelegatorValidatorsResponse is response type for the Query/DelegatorValidators RPC method
message QueryDelegatorValidatorsResponse {
repeated Validator validators = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}

// QueryDelegatorValidatorRequest is request type for the Query/DelegatorValidator RPC method
Expand Down Expand Up @@ -224,5 +224,5 @@ message QueryParamsRequest { }
message QueryParamsResponse {
Params params = 1 [(gogoproto.nullable) = false];

cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
}
12 changes: 6 additions & 6 deletions proto/ibc/channel/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ message QueryChannelResponse {
// QueryChannelsRequest is the request type for the Query/Channels RPC method
message QueryChannelsRequest {
// pagination request
cosmos.query.PageRequest req = 1;
cosmos.query.PageRequest pagination = 1;
}

// QueryChannelsResponse is the response type for the Query/Channels RPC method.
message QueryChannelsResponse {
// list of stored channels of the chain.
repeated ibc.channel.IdentifiedChannel channels = 1;
// pagination response
cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
// query block height
int64 height = 3;
}
Expand All @@ -81,15 +81,15 @@ message QueryConnectionChannelsRequest {
// connection unique identifier
string connection = 1;
// pagination request
cosmos.query.PageRequest req = 2;
cosmos.query.PageRequest pagination = 2;
}

// QueryConnectionChannelsResponse is the Response type for the Query/QueryConnectionChannels RPC method
message QueryConnectionChannelsResponse {
// list of channels associated with a connection.
repeated ibc.channel.IdentifiedChannel channels = 1;
// pagination response
cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
// query block height
int64 height = 3;
}
Expand Down Expand Up @@ -124,14 +124,14 @@ message QueryPacketCommitmentsRequest {
// channel unique identifier
string channel_id = 2 [(gogoproto.customname) = "ChannelID"];
// pagination request
cosmos.query.PageRequest req = 3;
cosmos.query.PageRequest pagination = 3;
}

// QueryPacketCommitmentsResponse is the request type for the Query/QueryPacketCommitments RPC method
message QueryPacketCommitmentsResponse {
repeated ibc.channel.PacketAckCommitment commitments = 1;
// pagination response
cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
// query block height
int64 height = 3;
}
Expand Down
4 changes: 2 additions & 2 deletions proto/ibc/connection/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ message QueryConnectionResponse {

// QueryConnectionsRequest is the request type for the Query/Connections RPC method
message QueryConnectionsRequest {
cosmos.query.PageRequest req = 1;
cosmos.query.PageRequest pagination = 1;
}

// QueryConnectionsResponse is the response type for the Query/Connections RPC method.
message QueryConnectionsResponse {
// list of stored connections of the chain.
repeated ibc.connection.ConnectionEnd connections = 1;
// pagination response
cosmos.query.PageResponse res = 2;
cosmos.query.PageResponse pagination = 2;
// query block height
int64 height = 3;
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ done

# generate codec/testdata proto code
protoc -I "proto" -I "third_party/proto" -I "testutil/testdata" --gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./codec/testdata/proto.proto
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. ./testutil/testdata/proto.proto

# move proto files to the right places
cp -r github.com/cosmos/cosmos-sdk/* ./
Expand Down
Loading

0 comments on commit 69bbb8b

Please sign in to comment.