Skip to content

Commit

Permalink
Remove proof list
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Nov 17, 2023
1 parent 1745b6a commit a0e9e8d
Show file tree
Hide file tree
Showing 17 changed files with 526 additions and 334 deletions.
265 changes: 265 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47646,6 +47646,189 @@ paths:
additionalProperties: {}
tags:
- Query
/pocket/supplier/proof:
get:
operationId: PocketSupplierProofAll
responses:
'200':
description: A successful response.
schema:
type: object
properties:
proof:
type: array
items:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
merkle_proof:
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/proof/{index}:
get:
summary: Queries a list of Proof items.
operationId: PocketSupplierProof
responses:
'200':
description: A successful response.
schema:
type: object
properties:
proof:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
merkle_proof:
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/supplier:
get:
operationId: PocketSupplierSupplierAll
Expand Down Expand Up @@ -78043,6 +78226,22 @@ definitions:
pocket.supplier.Params:
type: object
description: Params defines the parameters for the module.
pocket.supplier.Proof:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
merkle_proof:
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.QueryAllClaimsResponse:
type: object
properties:
Expand Down Expand Up @@ -78090,6 +78289,53 @@ definitions:
repeated Bar results = 1;
PageResponse page = 2;
}
pocket.supplier.QueryAllProofResponse:
type: object
properties:
proof:
type: array
items:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
merkle_proof:
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 @@ -78250,6 +78496,25 @@ definitions:
TODO_UPNEXT(@Olshansk): The structure below is the default (untouched)
scaffolded type. Update

and productionize it for our use case.
pocket.supplier.QueryGetProofResponse:
type: object
properties:
proof:
type: object
properties:
index:
type: string
supplier_address:
type: string
session_id:
type: string
merkle_proof:
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
Expand Down
17 changes: 11 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// NB: Since this repostiory was scaffolded using `ignite s chain pocket`

Check warning on line 1 in go.mod

View workflow job for this annotation

GitHub Actions / misspell

[misspell] go.mod#L1

"repostiory" is a misspelling of "repository"
Raw output
./go.mod:1:18: "repostiory" is a misspelling of "repository"
// but the module was later rename to the github repo name seen above, we
// but the module was later rename to github.com/pokt-network/poktroll, we
// need to swap the two lines below only during the scaffolding operation.
// Note that the operation will but all the necesary types will be generated.
// NOTE that the operation is expected to error out but all the necesary

Check warning on line 4 in go.mod

View workflow job for this annotation

GitHub Actions / misspell

[misspell] go.mod#L4

"necesary" is a misspelling of "necessary"
Raw output
./go.mod:4:64: "necesary" is a misspelling of "necessary"
// types and functions will be scaffolded correctly.
// Ref: https://github.com/ignite/cli/issues/3737
module github.com/pokt-network/poktroll
// module pocket

//
// The following will need to be done manually after the scaffold:
// - Reverting the module name in go.mod (this file)
// - Manually updating imports in .go files: "pocket/x/" => "github.com/pokt-network/pocket/x/"
// - Manually `option go_package` in .proto files: `option go_package = "pocket` => `option go_package = "github.com/pokt-network/poktroll`
// - If an empty `service Msg {}` is generated in a `tx.proto` file, remove it

// module pocket
module github.com/pokt-network/poktroll

go 1.20

Expand All @@ -30,7 +36,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
github.com/noot/ring-go v0.0.0-20231019173746-6c4b33bcf03f
github.com/pokt-network/poktroll v0.0.0-20231116164404-dd3434115ee1
github.com/pokt-network/smt v0.7.1
github.com/regen-network/gocuke v0.6.2
github.com/spf13/cast v1.5.1
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1591,8 +1591,6 @@ github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qR
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pokt-network/poktroll v0.0.0-20231116164404-dd3434115ee1 h1:Y0eeoa4cDqykM3dPmXW4D6nMKNlalV5YjGqzCbAglqE=
github.com/pokt-network/poktroll v0.0.0-20231116164404-dd3434115ee1/go.mod h1:YLe1YzoVPuhPXiyIzUzhKpwf/70mjUZxdbKpFpX6js8=
github.com/pokt-network/smt v0.7.1 h1:WHcZeMLe+9U1/kCAhdbssdyTYzYxxb74sf8MCvG34M8=
github.com/pokt-network/smt v0.7.1/go.mod h1:K7BLEOWoZGZmY5USQuYvTkZ3qXjE6m39BMufBvVo3U8=
github.com/polydawn/refmt v0.89.0 h1:ADJTApkvkeBZsN0tBTx8QjpD9JkmxbKp0cxfr9qszm4=
Expand Down
3 changes: 1 addition & 2 deletions proto/pocket/supplier/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ option go_package = "github.com/pokt-network/poktroll/x/supplier/types";
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated pocket.shared.Supplier supplierList = 2 [(gogoproto.nullable) = false];

// TODO_UPNEXT(@Olshansk): Delete `claimList` from the genesis state.
repeated Claim claimList = 3 [(gogoproto.nullable) = false];
repeated Proof proofList = 4 [(gogoproto.nullable) = false];
}

13 changes: 7 additions & 6 deletions proto/pocket/supplier/proof.proto
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
syntax = "proto3";
package pocket.supplier;

option go_package = "pocket/x/supplier/types";
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 Proof {
string index = 1;
string supplierAddress = 2;
string sessionId = 3;
string rootHash = 4;

string index = 1;
string supplier_address = 2;
string session_id = 3;
string merkle_proof = 4;
}

7 changes: 0 additions & 7 deletions proto/poktroll/supplier/tx.proto

This file was deleted.

Loading

0 comments on commit a0e9e8d

Please sign in to comment.