Skip to content

Commit

Permalink
Merge pull request #394 from osmosis-labs/fix/grpc-gateway-params
Browse files Browse the repository at this point in the history
Fix/grpc gateway params
  • Loading branch information
hoangdv2429 authored Jun 21, 2023
2 parents d9db745 + f71ed17 commit fd6b27a
Show file tree
Hide file tree
Showing 17 changed files with 418 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export class Query {
* buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
*/
static providerAuditorAttributes(request: QueryProviderAuditorRequest, initRequest?: fm.InitReq): Promise<QueryProvidersResponse> {
return fm.fetchReq(`/akash/audit/v1beta2/audit/attributes/${request["auditor"]}/{owner}?${fm.renderURLSearchParams({
return fm.fetchReq(`/akash/audit/v1beta2/audit/attributes/${request["auditor"]}/${request["owner"]}?${fm.renderURLSearchParams({
...request
}, ["auditor"])}`, {
}, ["auditor", "owner"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ export class Query {
}
/** DelegationRewards queries the total rewards accrued by a delegation. */
static delegationRewards(request: QueryDelegationRewardsRequest, initRequest?: fm.InitReq): Promise<QueryDelegationRewardsResponse> {
return fm.fetchReq(`/cosmos/distribution/v1beta1/delegators/${request["delegator_address"]}/rewards/{validator_address}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/distribution/v1beta1/delegators/${request["delegator_address"]}/rewards/${request["validator_address"]}?${fm.renderURLSearchParams({
...request
}, ["delegator_address"])}`, {
}, ["delegator_address", "validator_address"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { QueryAllowanceRequest, QueryAllowanceRequestSDKType, QueryAllowanceResp
export class Query {
/** Allowance returns fee granted to the grantee by the granter. */
static allowance(request: QueryAllowanceRequest, initRequest?: fm.InitReq): Promise<QueryAllowanceResponse> {
return fm.fetchReq(`/cosmos/feegrant/v1beta1/allowance/${request["granter"]}/{grantee}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/feegrant/v1beta1/allowance/${request["granter"]}/${request["grantee"]}?${fm.renderURLSearchParams({
...request
}, ["granter"])}`, {
}, ["granter", "grantee"])}`, {
...initRequest,
method: "GET"
});
Expand Down
8 changes: 4 additions & 4 deletions __fixtures__/v-next/outputv3/cosmos/gov/v1/query.rpc.Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class Query {
}
/** Vote queries voted information based on proposalID, voterAddr. */
static vote(request: QueryVoteRequest, initRequest?: fm.InitReq): Promise<QueryVoteResponse> {
return fm.fetchReq(`/cosmos/gov/v1/proposals/${request["proposal_id"]}/votes/{voter}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/gov/v1/proposals/${request["proposal_id"]}/votes/${request["voter"]}?${fm.renderURLSearchParams({
...request
}, ["proposal_id"])}`, {
}, ["proposal_id", "voter"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -50,9 +50,9 @@ export class Query {
}
/** Deposit queries single deposit information based proposalID, depositAddr. */
static deposit(request: QueryDepositRequest, initRequest?: fm.InitReq): Promise<QueryDepositResponse> {
return fm.fetchReq(`/cosmos/gov/v1/proposals/${request["proposal_id"]}/deposits/{depositor}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/gov/v1/proposals/${request["proposal_id"]}/deposits/${request["depositor"]}?${fm.renderURLSearchParams({
...request
}, ["proposal_id"])}`, {
}, ["proposal_id", "depositor"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class Query {
}
/** Vote queries voted information based on proposalID, voterAddr. */
static vote(request: QueryVoteRequest, initRequest?: fm.InitReq): Promise<QueryVoteResponse> {
return fm.fetchReq(`/cosmos/gov/v1beta1/proposals/${request["proposal_id"]}/votes/{voter}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/gov/v1beta1/proposals/${request["proposal_id"]}/votes/${request["voter"]}?${fm.renderURLSearchParams({
...request
}, ["proposal_id"])}`, {
}, ["proposal_id", "voter"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -50,9 +50,9 @@ export class Query {
}
/** Deposit queries single deposit information based proposalID, depositAddr. */
static deposit(request: QueryDepositRequest, initRequest?: fm.InitReq): Promise<QueryDepositResponse> {
return fm.fetchReq(`/cosmos/gov/v1beta1/proposals/${request["proposal_id"]}/deposits/{depositor}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/gov/v1beta1/proposals/${request["proposal_id"]}/deposits/${request["depositor"]}?${fm.renderURLSearchParams({
...request
}, ["proposal_id"])}`, {
}, ["proposal_id", "depositor"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export class Query {
}
/** VoteByProposalVoter queries a vote by proposal id and voter. */
static voteByProposalVoter(request: QueryVoteByProposalVoterRequest, initRequest?: fm.InitReq): Promise<QueryVoteByProposalVoterResponse> {
return fm.fetchReq(`/cosmos/group/v1/vote_by_proposal_voter/${request["proposal_id"]}/{voter}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/group/v1/vote_by_proposal_voter/${request["proposal_id"]}/${request["voter"]}?${fm.renderURLSearchParams({
...request
}, ["proposal_id"])}`, {
}, ["proposal_id", "voter"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { QueryBalanceRequest, QueryBalanceRequestSDKType, QueryBalanceResponse,
export class Query {
/** Balance queries the number of NFTs of a given class owned by the owner, same as balanceOf in ERC721 */
static balance(request: QueryBalanceRequest, initRequest?: fm.InitReq): Promise<QueryBalanceResponse> {
return fm.fetchReq(`/cosmos/nft/v1beta1/balance/${request["owner"]}/{class_id}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/nft/v1beta1/balance/${request["owner"]}/${request["class_id"]}?${fm.renderURLSearchParams({
...request
}, ["owner"])}`, {
}, ["owner", "class_id"])}`, {
...initRequest,
method: "GET"
});
}
/** Owner queries the owner of the NFT based on its class and id, same as ownerOf in ERC721 */
static owner(request: QueryOwnerRequest, initRequest?: fm.InitReq): Promise<QueryOwnerResponse> {
return fm.fetchReq(`/cosmos/nft/v1beta1/owner/${request["class_id"]}/{id}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/nft/v1beta1/owner/${request["class_id"]}/${request["id"]}?${fm.renderURLSearchParams({
...request
}, ["class_id"])}`, {
}, ["class_id", "id"])}`, {
...initRequest,
method: "GET"
});
Expand Down Expand Up @@ -44,9 +44,9 @@ export class Query {
}
/** NFT queries an NFT based on its class and id. */
static nFT(request: QueryNFTRequest, initRequest?: fm.InitReq): Promise<QueryNFTResponse> {
return fm.fetchReq(`/cosmos/nft/v1beta1/nfts/${request["class_id"]}/{id}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/nft/v1beta1/nfts/${request["class_id"]}/${request["id"]}?${fm.renderURLSearchParams({
...request
}, ["class_id"])}`, {
}, ["class_id", "id"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ export class Query {
}
/** Delegation queries delegate info for given validator delegator pair. */
static delegation(request: QueryDelegationRequest, initRequest?: fm.InitReq): Promise<QueryDelegationResponse> {
return fm.fetchReq(`/cosmos/staking/v1beta1/validators/${request["validator_addr"]}/delegations/{delegator_addr}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/staking/v1beta1/validators/${request["validator_addr"]}/delegations/${request["delegator_addr"]}?${fm.renderURLSearchParams({
...request
}, ["validator_addr"])}`, {
}, ["validator_addr", "delegator_addr"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -53,9 +53,9 @@ export class Query {
* pair.
*/
static unbondingDelegation(request: QueryUnbondingDelegationRequest, initRequest?: fm.InitReq): Promise<QueryUnbondingDelegationResponse> {
return fm.fetchReq(`/cosmos/staking/v1beta1/validators/${request["validator_addr"]}/delegations/{delegator_addr}/unbonding_delegation?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/staking/v1beta1/validators/${request["validator_addr"]}/delegations/${request["delegator_addr"]}/unbonding_delegation?${fm.renderURLSearchParams({
...request
}, ["validator_addr"])}`, {
}, ["validator_addr", "delegator_addr"])}`, {
...initRequest,
method: "GET"
});
Expand Down Expand Up @@ -107,9 +107,9 @@ export class Query {
* pair.
*/
static delegatorValidator(request: QueryDelegatorValidatorRequest, initRequest?: fm.InitReq): Promise<QueryDelegatorValidatorResponse> {
return fm.fetchReq(`/cosmos/staking/v1beta1/delegators/${request["delegator_addr"]}/validators/{validator_addr}?${fm.renderURLSearchParams({
return fm.fetchReq(`/cosmos/staking/v1beta1/delegators/${request["delegator_addr"]}/validators/${request["validator_addr"]}?${fm.renderURLSearchParams({
...request
}, ["delegator_addr"])}`, {
}, ["delegator_addr", "validator_addr"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ export class Query {
}
/** RawContractState gets single key from the raw store data of a contract */
static rawContractState(request: QueryRawContractStateRequest, initRequest?: fm.InitReq): Promise<QueryRawContractStateResponse> {
return fm.fetchReq(`/wasm/v1/contract/${request["address"]}/raw/{query_data}?${fm.renderURLSearchParams({
return fm.fetchReq(`/wasm/v1/contract/${request["address"]}/raw/${request["query_data"]}?${fm.renderURLSearchParams({
...request
}, ["address"])}`, {
}, ["address", "query_data"])}`, {
...initRequest,
method: "GET"
});
}
/** SmartContractState get smart query result from the contract */
static smartContractState(request: QuerySmartContractStateRequest, initRequest?: fm.InitReq): Promise<QuerySmartContractStateResponse> {
return fm.fetchReq(`/wasm/v1/contract/${request["address"]}/smart/{query_data}?${fm.renderURLSearchParams({
return fm.fetchReq(`/wasm/v1/contract/${request["address"]}/smart/${request["query_data"]}?${fm.renderURLSearchParams({
...request
}, ["address"])}`, {
}, ["address", "query_data"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class Query {
}
/** GasMeter Retrieves a active gas meter */
static gasMeter(request: QueryGasMeterRequest, initRequest?: fm.InitReq): Promise<QueryGasMeterResponse> {
return fm.fetchReq(`/evmos/incentives/v1/gas_meters/${request["contract"]}/{participant}?${fm.renderURLSearchParams({
return fm.fetchReq(`/evmos/incentives/v1/gas_meters/${request["contract"]}/${request["participant"]}?${fm.renderURLSearchParams({
...request
}, ["contract"])}`, {
}, ["contract", "participant"])}`, {
...initRequest,
method: "GET"
});
Expand Down
44 changes: 22 additions & 22 deletions __fixtures__/v-next/outputv3/ibc/core/channel/v1/query.rpc.Query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { QueryChannelRequest, QueryChannelRequestSDKType, QueryChannelResponse,
export class Query {
/** Channel queries an IBC Channel. */
static channel(request: QueryChannelRequest, initRequest?: fm.InitReq): Promise<QueryChannelResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id"])}`, {
...initRequest,
method: "GET"
});
Expand Down Expand Up @@ -40,9 +40,9 @@ export class Query {
* with the provided channel identifiers.
*/
static channelClientState(request: QueryChannelClientStateRequest, initRequest?: fm.InitReq): Promise<QueryChannelClientStateResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/client_state?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/client_state?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -52,18 +52,18 @@ export class Query {
* associated with the provided channel identifiers.
*/
static channelConsensusState(request: QueryChannelConsensusStateRequest, initRequest?: fm.InitReq): Promise<QueryChannelConsensusStateResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/consensus_state/revision/{revision_number}/height/{revision_height}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/consensus_state/revision/${request["revision_number"]}/height/${request["revision_height"]}?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "revision_number", "revision_height"])}`, {
...initRequest,
method: "GET"
});
}
/** PacketCommitment queries a stored packet commitment hash. */
static packetCommitment(request: QueryPacketCommitmentRequest, initRequest?: fm.InitReq): Promise<QueryPacketCommitmentResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_commitments/{sequence}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_commitments/${request["sequence"]}?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "sequence"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -73,9 +73,9 @@ export class Query {
* with a channel.
*/
static packetCommitments(request: QueryPacketCommitmentsRequest, initRequest?: fm.InitReq): Promise<QueryPacketCommitmentsResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_commitments?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_commitments?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -85,18 +85,18 @@ export class Query {
* queried chain
*/
static packetReceipt(request: QueryPacketReceiptRequest, initRequest?: fm.InitReq): Promise<QueryPacketReceiptResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_receipts/{sequence}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_receipts/${request["sequence"]}?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "sequence"])}`, {
...initRequest,
method: "GET"
});
}
/** PacketAcknowledgement queries a stored packet acknowledgement hash. */
static packetAcknowledgement(request: QueryPacketAcknowledgementRequest, initRequest?: fm.InitReq): Promise<QueryPacketAcknowledgementResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_acks/{sequence}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_acks/${request["sequence"]}?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "sequence"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -106,9 +106,9 @@ export class Query {
* with a channel.
*/
static packetAcknowledgements(request: QueryPacketAcknowledgementsRequest, initRequest?: fm.InitReq): Promise<QueryPacketAcknowledgementsResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_acknowledgements?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_acknowledgements?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -118,9 +118,9 @@ export class Query {
* channel and sequences.
*/
static unreceivedPackets(request: QueryUnreceivedPacketsRequest, initRequest?: fm.InitReq): Promise<QueryUnreceivedPacketsResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_commitments/{packet_commitment_sequences}/unreceived_packets?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_commitments/${request["packet_commitment_sequences"]}/unreceived_packets?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "packet_commitment_sequences"])}`, {
...initRequest,
method: "GET"
});
Expand All @@ -130,18 +130,18 @@ export class Query {
* with a channel and sequences.
*/
static unreceivedAcks(request: QueryUnreceivedAcksRequest, initRequest?: fm.InitReq): Promise<QueryUnreceivedAcksResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/packet_commitments/{packet_ack_sequences}/unreceived_acks?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/packet_commitments/${request["packet_ack_sequences"]}/unreceived_acks?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id", "packet_ack_sequences"])}`, {
...initRequest,
method: "GET"
});
}
/** NextSequenceReceive returns the next receive sequence for a given channel. */
static nextSequenceReceive(request: QueryNextSequenceReceiveRequest, initRequest?: fm.InitReq): Promise<QueryNextSequenceReceiveResponse> {
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/{port_id}/next_sequence?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/channel/v1/channels/${request["channel_id"]}/ports/${request["port_id"]}/next_sequence?${fm.renderURLSearchParams({
...request
}, ["channel_id"])}`, {
}, ["channel_id", "port_id"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ export class Query {
* a given height.
*/
static consensusState(request: QueryConsensusStateRequest, initRequest?: fm.InitReq): Promise<QueryConsensusStateResponse> {
return fm.fetchReq(`/ibc/core/client/v1/consensus_states/${request["client_id"]}/revision/{revision_number}/height/{revision_height}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/client/v1/consensus_states/${request["client_id"]}/revision/${request["revision_number"]}/height/${request["revision_height"]}?${fm.renderURLSearchParams({
...request
}, ["client_id"])}`, {
}, ["client_id", "revision_number", "revision_height"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export class Query {
* connection.
*/
static connectionConsensusState(request: QueryConnectionConsensusStateRequest, initRequest?: fm.InitReq): Promise<QueryConnectionConsensusStateResponse> {
return fm.fetchReq(`/ibc/core/connection/v1/connections/${request["connection_id"]}/consensus_state/revision/{revision_number}/height/{revision_height}?${fm.renderURLSearchParams({
return fm.fetchReq(`/ibc/core/connection/v1/connections/${request["connection_id"]}/consensus_state/revision/${request["revision_number"]}/height/${request["revision_height"]}?${fm.renderURLSearchParams({
...request
}, ["connection_id"])}`, {
}, ["connection_id", "revision_number", "revision_height"])}`, {
...initRequest,
method: "GET"
});
Expand Down
Loading

0 comments on commit fd6b27a

Please sign in to comment.