Skip to content

Commit

Permalink
chore: add comments in protobuf files
Browse files Browse the repository at this point in the history
  • Loading branch information
hallazzang committed Jul 25, 2024
1 parent 404fd17 commit 05b8942
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 49 deletions.
2 changes: 2 additions & 0 deletions proto/milkyway/tickers/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,7 @@ message GenesisState {
// Params defines the parameters of the module.
Params params = 1 [ (gogoproto.nullable) = false ];

// Tickers defines the denom-ticker map. Key is a denom and value is its
// ticker.
map<string, string> tickers = 2;
}
13 changes: 13 additions & 0 deletions proto/milkyway/tickers/v1/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ option go_package = "github.com/milkyway-labs/milkyway/x/tickers/types";
service Msg {
option (cosmos.msg.v1.service) = true;

// RegisterTicker defines the operation for registering a ticker.
rpc RegisterTicker(MsgRegisterTicker) returns (MsgRegisterTickerResponse);

// DeregisterTicker defines the operation for de-registering a ticker with
// the token denomination.
rpc DeregisterTicker(MsgDeregisterTicker)
returns (MsgDeregisterTickerResponse);

Expand All @@ -24,6 +27,8 @@ service Msg {
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

// MsgRegisterTicker defines the message structure for the RegisterTicker
// gRPC service method. It allows the authority to register a ticker.
message MsgRegisterTicker {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "tickers/MsgRegisterTicker";
Expand All @@ -32,13 +37,19 @@ message MsgRegisterTicker {
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// Denom represents the denomination of the token associated with the ticker.
string denom = 2;

// Ticker represents the ticker of the token denomination.
string ticker = 3;
}

// MsgRegisterTickerResponse is the return value of MsgRegisterTicker.
message MsgRegisterTickerResponse {}

// MsgDeregisterTicker defines the message structure for the DeregisterTicker
// gRPC service method. It allows the authority to de-register a ticker with
// the token denomination.
message MsgDeregisterTicker {
option (cosmos.msg.v1.signer) = "authority";
option (amino.name) = "tickers/MsgDeregisterTicker";
Expand All @@ -47,9 +58,11 @@ message MsgDeregisterTicker {
// overwritten).
string authority = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];

// Denom represents the denomination of the token associated with the ticker.
string denom = 2;
}

// MsgRegisterTickerResponse is the return value of MsgDeregisterTicker.
message MsgDeregisterTickerResponse {}

// MsgUpdateParams defines the message structure for the UpdateParams gRPC
Expand Down
6 changes: 0 additions & 6 deletions proto/milkyway/tickers/v1/models.proto

This file was deleted.

21 changes: 19 additions & 2 deletions proto/milkyway/tickers/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ service Query {
option (google.api.http).get = "/milkyway/tickers/v1/params";
}

// Ticker defines a gRPC query method that returns a ticker of the given
// token denomination.
rpc Ticker(QueryTickerRequest) returns (QueryTickerResponse) {
option (google.api.http).get = "/milkyway/tickers/v1/tickers/{denom}";
}

// Denoms defines a gRPC query method that returns all the token
// denominations associated with the given ticker.
rpc Denoms(QueryDenomsRequest) returns (QueryDenomsResponse) {
option (google.api.http).get = "/milkyway/tickers/v1/denoms/{ticker}";
}
Expand All @@ -33,17 +37,30 @@ message QueryParamsResponse {
Params params = 1 [ (gogoproto.nullable) = false ];
}

message QueryTickerRequest { string denom = 1; }
// QueryTickerRequest is the request type for the Query/Ticker RPC method.
message QueryTickerRequest {
// Denom is the token denomination for which the ticker is to be queried.
string denom = 1;
}

message QueryTickerResponse { string ticker = 1; }
// QueryTickerResponse is the response type for the Query/Ticker RPC method.
message QueryTickerResponse {
// Ticker is the ticker of the given token denomination.
string ticker = 1;
}

// QueryDenomsRequest is the request type for the Query/Denoms RPC method.
message QueryDenomsRequest {
// Ticker is the ticker for which the denoms are to be queried.
string ticker = 1;

cosmos.base.query.v1beta1.PageRequest pagination = 2;
}

// QueryDenomsResponse is the response type for the Query/Denoms RPC method.
message QueryDenomsResponse {
// Denom is the list of all the token denominations associated with the
// ticker.
repeated string denoms = 1;

cosmos.base.query.v1beta1.PageResponse pagination = 2;
Expand Down
4 changes: 3 additions & 1 deletion x/tickers/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions x/tickers/types/messages.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 0 additions & 37 deletions x/tickers/types/models.pb.go

This file was deleted.

17 changes: 17 additions & 0 deletions x/tickers/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 05b8942

Please sign in to comment.