Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Application] Scaffolded the Application type (without CRUD messages) and nothing else #47

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
210 changes: 210 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46437,6 +46437,167 @@ paths:
}
tags:
- Query
/pocket/application/application:
get:
operationId: PocketApplicationApplicationAll
responses:
'200':
description: A successful response.
schema:
type: object
properties:
application:
type: array
items:
type: object
properties:
address:
type: string
pagination:
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: >-
PageResponse is to be embedded in gRPC response messages where
the

corresponding request message has used PageRequest.

message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
parameters:
- name: pagination.key
description: |-
key is a value returned in PageResponse.next_key to begin
querying the next page most efficiently. Only one of offset or key
should be set.
in: query
required: false
type: string
format: byte
- name: pagination.offset
description: >-
offset is a numeric offset that can be used when key is unavailable.

It is less efficient than using key. Only one of offset or key
should

be set.
in: query
required: false
type: string
format: uint64
- name: pagination.limit
description: >-
limit is the total number of results to be returned in the result
page.

If left empty it will default to a value to be set by each app.
in: query
required: false
type: string
format: uint64
- name: pagination.count_total
description: >-
count_total is set to true to indicate that the result set should
include

a count of the total number of items available for pagination in
UIs.

count_total is only respected when offset is used. It is ignored
when key

is set.
in: query
required: false
type: boolean
- name: pagination.reverse
description: >-
reverse is set to true if results are to be returned in the
descending order.


Since: cosmos-sdk 0.43
in: query
required: false
type: boolean
tags:
- Query
/pocket/application/application/{address}:
get:
summary: Queries a list of Application items.
operationId: PocketApplicationApplication
responses:
'200':
description: A successful response.
schema:
type: object
properties:
application:
type: object
properties:
address:
type: string
default:
description: An unexpected error response.
schema:
type: object
properties:
code:
type: integer
format: int32
message:
type: string
details:
type: array
items:
type: object
properties:
'@type':
type: string
additionalProperties: {}
parameters:
- name: address
in: path
required: true
type: string
tags:
- Query
/pocket/application/params:
get:
summary: Parameters queries the parameters of the module.
Expand Down Expand Up @@ -75320,9 +75481,58 @@ definitions:
description: |-
Version defines the versioning scheme used to negotiate the IBC verison in
the connection handshake.
pocket.application.Application:
type: object
properties:
address:
type: string
pocket.application.Params:
type: object
description: Params defines the parameters for the module.
pocket.application.QueryAllApplicationResponse:
type: object
properties:
application:
type: array
items:
type: object
properties:
address:
type: string
pagination:
type: object
properties:
next_key:
type: string
format: byte
description: |-
next_key is the key to be passed to PageRequest.key to
query the next page most efficiently. It will be empty if
there are no more results.
total:
type: string
format: uint64
title: >-
total is total number of results available if
PageRequest.count_total

was set, its value is undefined otherwise
description: |-
PageResponse is to be embedded in gRPC response messages where the
corresponding request message has used PageRequest.

message SomeResponse {
repeated Bar results = 1;
PageResponse page = 2;
}
pocket.application.QueryGetApplicationResponse:
type: object
properties:
application:
type: object
properties:
address:
type: string
pocket.application.QueryParamsResponse:
type: object
properties:
Expand Down
10 changes: 10 additions & 0 deletions proto/pocket/application/application.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";
package pocket.application;

option go_package = "pocket/x/application/types";

message Application {
string address = 1;

}

6 changes: 5 additions & 1 deletion proto/pocket/application/genesis.proto
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
syntax = "proto3";

package pocket.application;

import "gogoproto/gogo.proto";
import "pocket/application/params.proto";
import "pocket/application/application.proto";

option go_package = "pocket/x/application/types";

// GenesisState defines the application module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
Params params = 1 [(gogoproto.nullable) = false];
repeated Application applicationList = 2 [(gogoproto.nullable) = false];
}

38 changes: 35 additions & 3 deletions proto/pocket/application/query.proto
Original file line number Diff line number Diff line change
@@ -1,26 +1,58 @@
syntax = "proto3";

package pocket.application;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "pocket/application/params.proto";
import "pocket/application/application.proto";

option go_package = "pocket/x/application/types";

// Query defines the gRPC querier service.
service Query {

// Parameters queries the parameters of the module.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/pocket/application/params";

}

// Queries a list of Application items.
rpc Application (QueryGetApplicationRequest) returns (QueryGetApplicationResponse) {
option (google.api.http).get = "/pocket/application/application/{address}";

}
rpc ApplicationAll (QueryAllApplicationRequest) returns (QueryAllApplicationResponse) {
option (google.api.http).get = "/pocket/application/application";

}
}

// QueryParamsRequest is request type for the Query/Params RPC method.
message QueryParamsRequest {}

// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {

// params holds all the parameters of this module.
Params params = 1 [(gogoproto.nullable) = false];
}
}

message QueryGetApplicationRequest {
string address = 1;
}

message QueryGetApplicationResponse {
Application application = 1 [(gogoproto.nullable) = false];
}

message QueryAllApplicationRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllApplicationResponse {
repeated Application application = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

2 changes: 2 additions & 0 deletions x/application/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command {
}

cmd.AddCommand(CmdQueryParams())
cmd.AddCommand(CmdListApplication())
cmd.AddCommand(CmdShowApplication())
// this line is used by starport scaffolding # 1

return cmd
Expand Down
Loading