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

[Supplier] Scaffold the Claim type #149

Merged
merged 18 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
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
265 changes: 265 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47430,6 +47430,189 @@ paths:
additionalProperties: {}
tags:
- Query
/pocket/supplier/claim:
get:
operationId: PocketSupplierAllClaims
responses:
'200':
description: A successful response.
schema:
type: object
properties:
claim:
type: array
items:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
root_hash:
type: string
description: >-
TODO_UPNEXT(@Olshansk): The structure below is the default
(untouched) scaffolded type. Update

and productionize it for our use case.
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/supplier/claim/{index}:
get:
summary: Queries a list of Claim items.
operationId: PocketSupplierClaim
responses:
'200':
description: A successful response.
schema:
type: object
properties:
claim:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
root_hash:
type: string
description: >-
TODO_UPNEXT(@Olshansk): The structure below is the default
(untouched) scaffolded type. Update

and productionize it for our use case.
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: index
in: path
required: true
type: string
tags:
- Query
/pocket/supplier/params:
get:
summary: Parameters queries the parameters of the module.
Expand Down Expand Up @@ -77864,6 +78047,22 @@ definitions:
title: >-
SupplierServiceConfig holds the service configuration the supplier stakes
for
pocket.supplier.Claim:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
root_hash:
type: string
description: >-
TODO_UPNEXT(@Olshansk): The structure below is the default (untouched)
scaffolded type. Update

and productionize it for our use case.
pocket.supplier.MsgCreateClaimResponse:
type: object
pocket.supplier.MsgStakeSupplierResponse:
Expand All @@ -77875,6 +78074,53 @@ definitions:
pocket.supplier.Params:
type: object
description: Params defines the parameters for the module.
pocket.supplier.QueryAllClaimResponse:
type: object
properties:
claim:
type: array
items:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
root_hash:
type: string
description: >-
TODO_UPNEXT(@Olshansk): The structure below is the default
(untouched) scaffolded type. Update

and productionize it for our use case.
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.supplier.QueryAllSupplierResponse:
type: object
properties:
Expand Down Expand Up @@ -78021,6 +78267,25 @@ definitions:
repeated Bar results = 1;
PageResponse page = 2;
}
pocket.supplier.QueryGetClaimResponse:
type: object
properties:
claim:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
root_hash:
type: string
description: >-
TODO_UPNEXT(@Olshansk): The structure below is the default (untouched)
scaffolded type. Update

and productionize it for our use case.
pocket.supplier.QueryGetSupplierResponse:
type: object
properties:
Expand Down
3 changes: 0 additions & 3 deletions proto/pocket/application/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ service Query {
// Parameters queries the parameters of the module.
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.
Expand Down
5 changes: 1 addition & 4 deletions proto/pocket/gateway/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ service Query {
// Parameters queries the parameters of the module.
rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/pocket/gateway/params";

}

// Queries a list of Gateway items.
rpc Gateway (QueryGetGatewayRequest) returns (QueryGetGatewayResponse) {
rpc Gateway (QueryGetGatewayRequest) returns (QueryGetGatewayResponse) {
option (google.api.http).get = "/pocket/gateway/gateway/{address}";

}
rpc GatewayAll (QueryAllGatewayRequest) returns (QueryAllGatewayResponse) {
option (google.api.http).get = "/pocket/gateway/gateway";

}
}
// QueryParamsRequest is request type for the Query/Params RPC method.
Expand Down
2 changes: 0 additions & 2 deletions proto/pocket/session/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ service Query {
// Parameters queries the parameters of the module.
rpc Params (QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/pocket/session/params";

}

// Queries a list of GetSession items.
rpc GetSession (QueryGetSessionRequest) returns (QueryGetSessionResponse) {
option (google.api.http).get = "/pocket/session/get_session";

}
}
// QueryParamsRequest is request type for the Query/Params RPC method.
Expand Down
14 changes: 14 additions & 0 deletions proto/pocket/supplier/claim.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
package pocket.supplier;

option go_package = "github.com/pokt-network/poktroll/x/supplier/types";

// TODO_UPNEXT(@Olshansk): The structure below is the default (untouched) scaffolded type. Update
// and productionize it for our use case.
message Claim {
string index = 1;
string supplier_address = 2;
string session_id = 3;
string root_hash = 4;
}

5 changes: 4 additions & 1 deletion proto/pocket/supplier/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ package pocket.supplier;
import "gogoproto/gogo.proto";
import "pocket/supplier/params.proto";
import "pocket/shared/supplier.proto";
import "pocket/supplier/claim.proto";

option go_package = "github.com/pokt-network/poktroll/x/supplier/types";

// GenesisState defines the supplier module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
Params params = 1 [(gogoproto.nullable) = false];
repeated pocket.shared.Supplier supplierList = 2 [(gogoproto.nullable) = false];
// TODO_UPNEXT(@Olshansk): Delete `claimList` from the genesis state.
Olshansk marked this conversation as resolved.
Show resolved Hide resolved
repeated Claim claimList = 3 [(gogoproto.nullable) = false];
}

Loading