Skip to content

Commit 151b73c

Browse files
committed
Attempt 2, add old cork protos and regen their bindings
1 parent 8ceebb8 commit 151b73c

13 files changed

+397
-159
lines changed

proto/buf.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ deps:
1919
- remote: buf.build
2020
owner: googleapis
2121
repository: googleapis
22-
commit: e7f8d366f5264595bcc4cd4139af9973
23-
digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509
22+
commit: 553fd4b4b3a640be9b69a3fa0c17b383
23+
digest: shake256:e30e3247f84b7ff9d09941ce391eb4b6f04734e1e5fae796bfc471f167e6f90813630cc39397ee46b8bc0ea7d6935c416d15c219cc5732d9778cbfdf73a1ed6e

proto/cork/v1/cork.proto

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
syntax = "proto3";
2+
package cork.v1;
3+
4+
option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1";
5+
6+
message Cork {
7+
// call body containing the ABI encoded bytes to send to the contract
8+
bytes encoded_contract_call = 1;
9+
// address of the contract to send the call
10+
string target_contract_address = 2;
11+
}
12+
13+
message ValidatorCork {
14+
Cork cork = 1;
15+
string validator = 2;
16+
}
17+
18+
message ScheduledCork {
19+
Cork cork = 1;
20+
uint64 block_height = 2;
21+
string validator = 3;
22+
}
23+
24+
message CellarIDSet {
25+
repeated string ids = 1;
26+
}

proto/cork/v1/genesis.proto

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
syntax = "proto3";
2+
package cork.v1;
3+
4+
import "cork/v1/tx.proto";
5+
import "cork/v1/cork.proto";
6+
import "gogoproto/gogo.proto";
7+
8+
option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1";
9+
10+
11+
// GenesisState - all cork state that must be provided at genesis
12+
message GenesisState {
13+
Params params = 1 [
14+
(gogoproto.nullable) = false
15+
];
16+
CellarIDSet cellar_ids = 2 [
17+
(gogoproto.nullable) = false
18+
];
19+
uint64 invalidation_nonce = 3;
20+
repeated ValidatorCork corks = 4;
21+
repeated ScheduledCork scheduled_corks = 5;
22+
}
23+
24+
// Params cork parameters
25+
message Params {
26+
// VotePeriod defines the number of blocks to wait for votes before attempting to tally
27+
int64 vote_period = 1 [(gogoproto.moretags) = "yaml:\"vote_period\""];
28+
29+
// VoteThreshold defines the percentage of bonded stake required to vote each period
30+
string vote_threshold = 2 [
31+
(gogoproto.moretags) = "yaml:\"vote_threshold\"",
32+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
33+
(gogoproto.nullable) = false
34+
];
35+
}

proto/cork/v1/proposal.proto

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
syntax = "proto3";
2+
package cork.v1;
3+
4+
import "cork/v1/cork.proto";
5+
import "gogoproto/gogo.proto";
6+
7+
option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1";
8+
9+
message AddManagedCellarIDsProposal {
10+
string title = 1;
11+
string description = 2;
12+
CellarIDSet cellar_ids = 3;
13+
}
14+
15+
// AddManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands
16+
message AddManagedCellarIDsProposalWithDeposit {
17+
string title = 1;
18+
string description = 2;
19+
repeated string cellar_ids = 3;
20+
string deposit = 4;
21+
}
22+
23+
message RemoveManagedCellarIDsProposal {
24+
string title = 1;
25+
string description = 2;
26+
CellarIDSet cellar_ids = 3;
27+
}
28+
29+
// RemoveManagedCellarIDsProposalWithDeposit is a specific definition for CLI commands
30+
message RemoveManagedCellarIDsProposalWithDeposit {
31+
string title = 1;
32+
string description = 2;
33+
repeated string cellar_ids = 3;
34+
string deposit = 4;
35+
}

proto/cork/v1/query.proto

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
syntax = "proto3";
2+
package cork.v1;
3+
4+
import "gogoproto/gogo.proto";
5+
import "google/api/annotations.proto";
6+
import "cork/v1/genesis.proto";
7+
import "cork/v1/cork.proto";
8+
import "cosmos_proto/cosmos.proto";
9+
import "cosmos/base/query/v1beta1/pagination.proto";
10+
11+
option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1";
12+
13+
// Query defines the gRPC query service for the cork module.
14+
service Query {
15+
// QueryParams queries the allocation module parameters.
16+
rpc QueryParams(QueryParamsRequest) returns (QueryParamsResponse) {
17+
option (google.api.http).get = "/sommelier/cork/v1/params";
18+
}
19+
// QuerySubmittedCorks queries the submitted corks awaiting vote
20+
rpc QuerySubmittedCorks(QuerySubmittedCorksRequest) returns (QuerySubmittedCorksResponse) {
21+
option (google.api.http).get = "/sommelier/cork/v1/submitted";
22+
}
23+
// QueryCommitPeriod queries the heights for the current voting period (current, start and end)
24+
rpc QueryCommitPeriod(QueryCommitPeriodRequest) returns (QueryCommitPeriodResponse) {
25+
option (google.api.http).get = "/sommelier/cork/v1/commit_period";
26+
}
27+
// QueryCellarIDs returns all cellars and current tick ranges
28+
rpc QueryCellarIDs(QueryCellarIDsRequest) returns (QueryCellarIDsResponse) {
29+
option (google.api.http).get = "/sommelier/cork/v1/cellar_ids";
30+
}
31+
// QueryScheduledCorks returns all scheduled corks
32+
rpc QueryScheduledCorks(QueryScheduledCorksRequest) returns (QueryScheduledCorksResponse) {
33+
option (google.api.http).get = "/sommelier/cork/v1/scheduled_corks";
34+
}
35+
// QueryScheduledBlockHeights returns all scheduled block heights
36+
rpc QueryScheduledBlockHeights(QueryScheduledBlockHeightsRequest) returns (QueryScheduledBlockHeightsResponse) {
37+
option (google.api.http).get = "/sommelier/cork/v1/scheduled_block_heights";
38+
}
39+
40+
// QueryScheduledCorks returns all scheduled corks at a block height
41+
rpc QueryScheduledCorksByBlockHeight(QueryScheduledCorksByBlockHeightRequest) returns (QueryScheduledCorksByBlockHeightResponse) {
42+
option (google.api.http).get = "/sommelier/cork/v1/scheduled_corks_by_block_height/{block_height}";
43+
}
44+
}
45+
46+
// QueryParamsRequest is the request type for the Query/Params gRPC method.
47+
message QueryParamsRequest {}
48+
49+
// QueryParamsRequest is the response type for the Query/Params gRPC method.
50+
message QueryParamsResponse {
51+
// allocation parameters
52+
Params params = 1 [(gogoproto.nullable) = false];
53+
}
54+
55+
// QuerySubmittedCorksRequest is the request type for the Query/QuerySubmittedCorks gRPC query method.
56+
message QuerySubmittedCorksRequest {}
57+
58+
// QuerySubmittedCorksResponse is the response type for the Query/QuerySubmittedCorks gRPC query method.
59+
message QuerySubmittedCorksResponse {
60+
// corks in keeper awaiting vote
61+
repeated Cork corks = 1;
62+
}
63+
64+
65+
// QueryCommitPeriodRequest is the request type for the Query/QueryCommitPeriod gRPC method.
66+
message QueryCommitPeriodRequest {}
67+
68+
// QueryCommitPeriodResponse is the response type for the Query/QueryCommitPeriod gRPC method.
69+
message QueryCommitPeriodResponse {
70+
// block height at which the query was processed
71+
int64 current_height = 1;
72+
// latest vote period start block height
73+
int64 vote_period_start = 2;
74+
// block height at which the current voting period ends
75+
int64 vote_period_end = 3;
76+
}
77+
78+
79+
// QueryCellarIDsRequest is the request type for Query/QueryCellarIDs gRPC method.
80+
message QueryCellarIDsRequest {}
81+
82+
// QueryCellarIDsResponse is the response type for Query/QueryCellars gRPC method.
83+
message QueryCellarIDsResponse {
84+
repeated string cellar_ids = 1;
85+
}
86+
87+
// QueryScheduledCorksRequest
88+
message QueryScheduledCorksRequest {}
89+
90+
// QueryScheduledCorksResponse
91+
message QueryScheduledCorksResponse {
92+
repeated ScheduledCork corks = 1;
93+
}
94+
95+
// QueryScheduledBlockHeightsRequest
96+
message QueryScheduledBlockHeightsRequest {}
97+
98+
// QueryScheduledBlockHeightsResponse
99+
message QueryScheduledBlockHeightsResponse {
100+
repeated uint64 block_heights = 1;
101+
}
102+
103+
// QueryScheduledCorksByBlockHeightRequest
104+
message QueryScheduledCorksByBlockHeightRequest {
105+
uint64 block_height = 1;
106+
}
107+
108+
// QueryScheduledCorksByBlockHeightResponse
109+
message QueryScheduledCorksByBlockHeightResponse {
110+
repeated ScheduledCork corks = 1;
111+
}

proto/cork/v1/tx.proto

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
syntax = "proto3";
2+
package cork.v1;
3+
4+
import "cork/v1/cork.proto";
5+
6+
option go_package = "github.com/peggyjv/sommelier/v8/x/cork/types/v1";
7+
8+
// MsgService defines the msgs that the cork module handles
9+
service Msg {
10+
rpc SubmitCork (MsgSubmitCorkRequest) returns (MsgSubmitCorkResponse);
11+
rpc ScheduleCork (MsgScheduleCorkRequest) returns (MsgScheduleCorkResponse);
12+
}
13+
14+
// MsgSubmitCorkRequest - sdk.Msg for submitting calls to Ethereum through the gravity bridge contract
15+
message MsgSubmitCorkRequest {
16+
// the cork to send across the bridge
17+
Cork cork = 1;
18+
// signer account address
19+
string signer = 2;
20+
}
21+
22+
message MsgSubmitCorkResponse {}
23+
24+
// MsgScheduleCorkRequest - sdk.Msg for scheduling a cork request for on or after a specific block height
25+
message MsgScheduleCorkRequest {
26+
// the scheduled cork
27+
Cork cork = 1;
28+
// the block height that must be reached
29+
uint64 block_height = 2;
30+
// signer account address
31+
string signer = 3;
32+
}
33+
34+
message MsgScheduleCorkResponse {}

x/cork/module.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *r
7272

7373
// RegisterInterfaces implements app module basic
7474
func (b AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) {
75-
v1types.RegisterInterfaces(registry)
7675
types.RegisterInterfaces(registry)
76+
v1types.RegisterInterfaces(registry)
7777
}
7878

7979
// AppModule implements an application module for the cork module.

x/cork/types/v1/cork.pb.go

+22-24
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x/cork/types/v1/genesis.pb.go

+28-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)