Skip to content

Commit

Permalink
fix proto lint err
Browse files Browse the repository at this point in the history
  • Loading branch information
trestinlsd committed Nov 1, 2024
1 parent d9f397c commit 5982409
Showing 1 changed file with 24 additions and 36 deletions.
60 changes: 24 additions & 36 deletions proto/exocore/operator/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ import "cosmos/staking/v1beta1/staking.proto";
import "cosmos/query/v1/query.proto";
import "amino/amino.proto";


option go_package = "github.com/ExocoreNetwork/exocore/x/operator/types";

// QueryOperatorInfoReq is the request to obtain the operator information.
message GetOperatorInfoReq {
// operator_addr is the operator address,its type should be a sdk.AccAddress
string operator_addr = 1
[(cosmos_proto.scalar) = "cosmos.AddressString"];
string operator_addr = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// QueryAllOperatorsRequest is the request to obtain all operators.
Expand Down Expand Up @@ -46,21 +44,20 @@ message OperatorAVSAddress {
// QueryOperatorUSDValueRequest is the request to obtain the USD value for operator.
message QueryOperatorUSDValueRequest {
// operator_and_avs is the operator and AVS address
OperatorAVSAddress operator_and_avs = 1 [(gogoproto.embed) = true];;
OperatorAVSAddress operator_and_avs = 1 [(gogoproto.embed) = true];
;
}

// QueryOperatorUSDValueResponse is the response to obtain the USD value for operator.
message QueryOperatorUSDValueResponse {
// usd_info includes the self and total staking for the operator and AVS
OperatorOptedUSDValue usd_values = 1
[(gogoproto.customname) = "USDValues"];
OperatorOptedUSDValue usd_values = 1 [(gogoproto.customname) = "USDValues"];
}

// QueryAVSUSDValueRequest is the request to obtain the USD value for AVS.
message QueryAVSUSDValueRequest {
// avs_address is the AVS address opted-in by the operator
string avs_address = 1
[(gogoproto.customname) = "AVSAddress"];
string avs_address = 1 [(gogoproto.customname) = "AVSAddress"];
}

// QueryOperatorSlashInfoRequest is the request to obtain the slash information for the specified
Expand All @@ -82,7 +79,7 @@ message OperatorSlashInfoByID {
}

// QueryOperatorSlashInfoResponse is the response for GetOperatorSlashInfoRequest
message QueryOperatorSlashInfoResponse{
message QueryOperatorSlashInfoResponse {
// all_slash_info is a list of the slash information for the specified operator and AVS
repeated OperatorSlashInfoByID all_slash_info = 1;
// pagination related response.
Expand Down Expand Up @@ -189,7 +186,6 @@ message OperatorConsAddrPair {
bool opting_out = 3;
}


// QueryAllOperatorsWithOptInAVSRequest is the request to obtain all opt-in operator addresses
// for a specific avs with pagination.
message QueryAllOperatorsByOptInAVSRequest {
Expand Down Expand Up @@ -240,65 +236,56 @@ service Query {
}

// QueryOperatorConsKeyForChainID queries the consensus public key for the operator
rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns (
QueryOperatorConsKeyResponse
) {
rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyRequest) returns (QueryOperatorConsKeyResponse) {
option (google.api.http) = {
get: "/exocore/operator/v1/operator_cons_key/{operator_acc_addr}/{chain}"
};
}

// QueryOperatorConsAddressForChainID queries the consensus address for the operator.
rpc QueryOperatorConsAddressForChainID(QueryOperatorConsAddressRequest) returns (
QueryOperatorConsAddressResponse
) {
rpc QueryOperatorConsAddressForChainID(QueryOperatorConsAddressRequest) returns (QueryOperatorConsAddressResponse) {
option (google.api.http) = {
get: "/exocore/operator/v1/operator_cons_addr/{operator_acc_addr}/{chain}"
};
}

// QueryAllOperatorConsKeysByChainID queries all operators and their consensus public keys
// for a specific chain ID
rpc QueryAllOperatorConsKeysByChainID(QueryAllOperatorConsKeysByChainIDRequest) returns (
QueryAllOperatorConsKeysByChainIDResponse
) {
rpc QueryAllOperatorConsKeysByChainID(QueryAllOperatorConsKeysByChainIDRequest)
returns (QueryAllOperatorConsKeysByChainIDResponse) {
option (google.api.http) = {
get: "/exocore/operator/v1/all_operator_cons_keys/{chain}"
};
}

// QueryOperatorUSDValue queries the opted-in USD value for the operator
rpc QueryOperatorUSDValue(QueryOperatorUSDValueRequest) returns(QueryOperatorUSDValueResponse){
option (google.api.http).get =
"/exocore/operator/v1/QueryOperatorUSDValue/{operator_and_avs.operator_addr}/"
"{operator_and_avs.avs_address}";
rpc QueryOperatorUSDValue(QueryOperatorUSDValueRequest) returns (QueryOperatorUSDValueResponse) {
option (google.api.http).get = "/exocore/operator/v1/QueryOperatorUSDValue/{operator_and_avs.operator_addr}/"
"{operator_and_avs.avs_address}";
}

// QueryAVSUSDValue queries the USD value for the AVS
rpc QueryAVSUSDValue(QueryAVSUSDValueRequest) returns(DecValueField){
rpc QueryAVSUSDValue(QueryAVSUSDValueRequest) returns (DecValueField) {
option (google.api.http).get = "/exocore/operator/v1/QueryAVSUSDValue";
}

// QueryOperatorSlashInfo queries the slash information for the specified operator and AVS
rpc QueryOperatorSlashInfo(QueryOperatorSlashInfoRequest) returns(QueryOperatorSlashInfoResponse){
option (google.api.http).get =
"/exocore/operator/v1/QueryOperatorSlashInfo/{operator_and_avs.operator_addr}/"
"{operator_and_avs.avs_address}";
rpc QueryOperatorSlashInfo(QueryOperatorSlashInfoRequest) returns (QueryOperatorSlashInfoResponse) {
option (google.api.http).get = "/exocore/operator/v1/QueryOperatorSlashInfo/{operator_and_avs.operator_addr}/"
"{operator_and_avs.avs_address}";
}

// QueryAllOperatorConsAddrsByChainID queries all operators and their consensus addresses
// for a specific chain ID
rpc QueryAllOperatorConsAddrsByChainID(QueryAllOperatorConsAddrsByChainIDRequest) returns (
QueryAllOperatorConsAddrsByChainIDResponse
) {
rpc QueryAllOperatorConsAddrsByChainID(QueryAllOperatorConsAddrsByChainIDRequest)
returns (QueryAllOperatorConsAddrsByChainIDResponse) {
option (google.api.http) = {
get: "/exocore/operator/v1/all_operator_cons_addrs/{chain}"
};
}

// QueryAllOperatorsWithOptInAVS queries operator list by avs.
rpc QueryAllOperatorsWithOptInAVS(QueryAllOperatorsByOptInAVSRequest) returns (
QueryAllOperatorsByOptInAVSResponse) {
rpc QueryAllOperatorsWithOptInAVS(QueryAllOperatorsByOptInAVSRequest) returns (QueryAllOperatorsByOptInAVSResponse) {
option (google.api.http) = {
get: "/exocore/operator/v1/opt/operator_list/{avs}"
};
Expand All @@ -323,13 +310,13 @@ service Query {
// gas if the pagination field is incorrectly set.
rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/exocore/operator/v1/validators";
option (google.api.http).get = "/exocore/operator/v1/validators";
}

// Validator queries validator info for given validator address.
rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/exocore/operator/v1/validators/{validator_addr}";
option (google.api.http).get = "/exocore/operator/v1/validators/{validator_addr}";
}
}
// QueryValidatorsRequest is request type for Query/Validators RPC method.
Expand All @@ -345,7 +332,8 @@ message QueryValidatorsRequest {
// QueryValidatorsResponse is response type for the Query/Validators RPC method
message QueryValidatorsResponse {
// validators contains all the queried validators.
repeated cosmos.staking.v1beta1.Validator validators = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
repeated cosmos.staking.v1beta1.Validator validators = 1
[(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
Expand Down

0 comments on commit 5982409

Please sign in to comment.