Skip to content

Commit

Permalink
chore(ci): add comments to all fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Mar 4, 2024
1 parent 258807d commit 7b9871a
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 25 deletions.
23 changes: 20 additions & 3 deletions proto/exocore/delegation/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,25 @@ import "google/api/annotations.proto";

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

// DelegationInfoReq is the request to obtain the delegation information
// by staker id and asset id.
message DelegationInfoReq {
// staker_id is the staker id.
string staker_id = 1 [(gogoproto.customname) = "StakerID"];
// asset_id is the asset id.
string asset_id = 2 [(gogoproto.customname) = "AssetID"];
}

// DelegationAmounts is the delegation amount response for a single delegation.
message DelegationAmounts {
// can_undelegation_amount is the amount that can be undelegated.
string can_undelegation_amount = 1
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// wait_undelegation_amount is the amount that is waiting to be unbonded.
string wait_undelegation_amount = 2
[
(cosmos_proto.scalar) = "cosmos.Int",
Expand All @@ -29,31 +36,41 @@ message DelegationAmounts {
];
}

// QueryDelegationInfoResponse is the response for delegations by staker id and
// asset id.
message QueryDelegationInfoResponse {
// total_delegated_amount is the total amount that is delegated.
string total_delegated_amount = 1
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
map<string, DelegationAmounts > delegation_infos = 2;
// delegation_infos is the delegation information for each operator.
map<string, DelegationAmounts> delegation_infos = 2;
}

// SingleDelegationInfoReq is the request to obtain the single delegation information.
message SingleDelegationInfoReq {
// staker_id is the staker id.
string staker_id = 1 [(gogoproto.customname) = "StakerID"];
// operator_addr is the operator address.
string operator_addr = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// asset_id is the asset id.
string asset_id = 3 [(gogoproto.customname) = "AssetID"];
}

// QueryOperatorInfoReq is the request to obtain the operator information.
message QueryOperatorInfoReq {
// operator_addr is the operator address.
string operator_addr = 1
[(cosmos_proto.scalar) = "cosmos.AddressString"];
}

// Query is the service API for the delegation module.
service Query {
// OperatorInfo queries the operator information.
rpc QueryOperatorInfo(QueryOperatorInfoReq) returns(OperatorInfo){
rpc QueryOperatorInfo(QueryOperatorInfoReq) returns (OperatorInfo) {
option (google.api.http).get = "/exocore/delegation/v1/GetOperatorInfo";
}
// DelegationInfo queries the delegation information for {stakerID, assetID}.
Expand All @@ -63,7 +80,7 @@ service Query {
}
// SingleDelegationInfo queries the single delegation information for
// {chain, staker, asset, operator}.
rpc QuerySingleDelegationInfo(SingleDelegationInfoReq) returns(DelegationAmounts){
rpc QuerySingleDelegationInfo(SingleDelegationInfoReq) returns (DelegationAmounts) {
option (cosmos.query.v1.module_query_safe) = true;
option (google.api.http).get = "/exocore/delegation/v1/QuerySingleDelegationInfo";
}
Expand Down
56 changes: 52 additions & 4 deletions proto/exocore/delegation/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import "gogoproto/gogo.proto";

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

// ValueField is a field that holds a value of sdk.Int type.
message ValueField {
// amount is the amount of the asset, as an sdk.Int.
string amount = 1
[
(cosmos_proto.scalar) = "cosmos.Int",
Expand All @@ -18,84 +20,123 @@ message ValueField {
];
}

// DelegatedSingleAssetInfo is a single asset info that is delegated by a staker.
message DelegatedSingleAssetInfo {
// asset_id is the asset id.
string asset_id = 1 [(gogoproto.customname) = "AssetID"];
// total_delegated_amount is the total amount of the asset delegated.
string total_delegated_amount = 2
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// per_operator_amounts is the amount of the asset delegated to each operator.
map<string, ValueField> per_operator_amounts = 3;
}

// ClientChainEarningAddrList is the list of client chain earning addresses.
message ClientChainEarningAddrList {
// earning_info_list is the contents of ClientChainEarningAddrList.
repeated ClientChainEarningAddrInfo earning_info_list = 1;
}

// ClientChainEarningAddrInfo is the client chain earning address info.
message ClientChainEarningAddrInfo {
// lz_client_chain_id is the layer0 client chain id.
uint64 lz_client_chain_id = 1 [(gogoproto.customname) = "LzClientChainID"];
// client_chain_earning_addr is the client chain earning address.
string client_chain_earning_addr = 2;
}

// OperatorInfo is the operator info.
message OperatorInfo {
// earnings_addr is the earnings address.
string earnings_addr = 1;
// approve_addr is the approve address.
string approve_addr = 2;
// operator_meta_info is the operator meta info.
string operator_meta_info = 3;
// client_chain_earning_addr_list is the client chain earning address list.
ClientChainEarningAddrList client_chain_earnings_addr = 4;
}

// RegisterOperatorReq is the request to register a new operator.
message RegisterOperatorReq {
option (cosmos.msg.v1.signer) = "FromAddress";
option (amino.name) = "cosmos-sdk/OperatorInfo";
option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// from_address is the address of the operator (sdk.AccAddress).
string from_address = 1
[(cosmos_proto.scalar) = "cosmos.AddressString"];
// info is the operator info.
OperatorInfo info = 2;
}

// DelegationApproveInfo is the delegation approve info.
message DelegationApproveInfo {
// signature of the delegation approve info.
string signature = 1;
// salt within the signature.
string salt = 2;
}

message RegisterOperatorResponse{}
// RegisterOperatorResponse is the response to a register operator request.
message RegisterOperatorResponse {}

// DelegationIncOrDecInfo is the delegation increase or decrease info.
message DelegationIncOrDecInfo {
option (cosmos.msg.v1.signer) = "fromAddress";
option (amino.name) = "cosmos-sdk/MsgAddOrDecreaseDelegation";

option (gogoproto.equal) = false;
option (gogoproto.goproto_getters) = false;

// from_address is the staker address
string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];

// per_operator_amounts is the amount of the asset delegated to each operator.
map<string, ValueField> per_operator_amounts = 2;
}

// MsgDelegation is the delegation Msg.
message MsgDelegation {
// base_info is the delegation increase or decrease request container.
DelegationIncOrDecInfo base_info = 1;
// approved_info is the delegation increase or decrease response container.
DelegationApproveInfo approved_info = 2;
}

// UndelegationRecord is the undelegation record, keyed by a RecordKey.
message UndelegationRecord {
// staker_id is the staker id.
string staker_id = 1 [(gogoproto.customname) = "StakerID"];
// asset_id is the asset id.
string asset_id = 2 [(gogoproto.customname) = "AssetID"];
string operator_addr = 3
[(cosmos_proto.scalar) = "cosmos.AddressString"];
// operator_addr is the operator address.
string operator_addr = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// tx_hash is the transaction hash on the client chain.
string tx_hash = 4;
// is_pending is the flag to indicate if the undelegation is pending.
bool is_pending = 5;
// block_number is the block number on Exocore.
uint64 block_number = 6;
// complete_block_number is the block number on Exocore at which the undelegation
// should be completed.
uint64 complete_block_number = 7;
// lz_tx_nonce is the nonce of the transaction on the client chain.
uint64 lz_tx_nonce = 8;
// amount is the amount of the asset to be undelegated.
string amount = 9
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// actual_completed_amount is the actual amount of the asset that has been
// undelegated so far. it may be lower than the amount in the case of slashing.
string actual_completed_amount =10
[
(cosmos_proto.scalar) = "cosmos.Int",
Expand All @@ -104,16 +145,23 @@ message UndelegationRecord {
];
}

// UndelegationRecordKeyList is the list of undelegation records.
message UndelegationRecordKeyList {
// key_list is the list of undelegation record keys.
repeated string key_list = 1;
}

// DelegationResponse is the response to a delegation request.
message DelegationResponse {}

// MsgUndelegation is the undelegation Msg.
message MsgUndelegation {
// base_info is the delegation increase or decrease request container.
DelegationIncOrDecInfo base_info = 1;
}
message UndelegationResponse{}

// UndelegationResponse is the response to an undelegation request.
message UndelegationResponse {}

// Msg defines the delegation Msg service.
service Msg {
Expand Down
2 changes: 2 additions & 0 deletions proto/exocore/deposit/v1/deposit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ option go_package = "github.com/ExocoreNetwork/exocore/x/deposit/types";

// GenesisState defines the restaking_assets_manage module's genesis state.
message Params {
// exocore_lz_app_address is the address of the exocore lz app.
string exocore_lz_app_address = 1
[(gogoproto.customname) = "ExoCoreLzAppAddress"];
// exocore_lz_app_event_topic is the topic of the exocore lz app event.
string exocore_lz_app_event_topic = 2
[(gogoproto.customname) = "ExoCoreLzAppEventTopic"];
}
1 change: 1 addition & 0 deletions proto/exocore/deposit/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC
// method.
message QueryParamsResponse {
// params defines the parameters for this module.
Params params = 1 ;
}

Expand Down
16 changes: 13 additions & 3 deletions proto/exocore/native_token/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "gogoproto/gogo.proto";

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

// ValidatorInfo is the information about a validator.
message ValidatorInfo {
// ValidatorStatus is the status of the validator.
enum ValidatorStatus {
Expand All @@ -19,32 +20,41 @@ message ValidatorInfo {
// WITHDRAWN is the status of a validator that has withdrawn from the network.
VALIDATOR_STATUS_WITHDRAWN = 3[ (gogoproto.enumvalue_customname) = "ValidatorInfo_WITHDRAWN" ];
}
// status is the validator's status as an enum.
ValidatorStatus status = 1;
// validator_index is the index of the validator in the set of validators.
uint64 validator_index = 2;
// staked_balance_gwei is the amount of native token staked by the validator in gwei.
string staked_balance_gwei = 3
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// most_recent_balance_update_block_number is the block number at which the
// validator's balance was last updated.
uint64 most_recent_balance_update_block_number = 4;
}

// NativeTokenStakerInfo is the information about a native token staker.
message NativeTokenStakerInfo {
// total_validator_balances is the total amount of native token staked.
string total_validator_balances = 1
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
string unstaked_value_from_pos = 2
// unstaked_value_from_pod is the value unstaked from the pod.
string unstaked_value_from_pod = 2

Check failure on line 49 in proto/exocore/native_token/v1/tx.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "2" with name "unstaked_value_from_pod" on message "NativeTokenStakerInfo" changed option "json_name" from "unstakedValueFromPos" to "unstakedValueFromPod".

Check failure on line 49 in proto/exocore/native_token/v1/tx.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "2" on message "NativeTokenStakerInfo" changed name from "unstaked_value_from_pos" to "unstaked_value_from_pod".
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false,
(gogoproto.customname) = "UnStakedValueFromPOS"
(gogoproto.nullable) = false
];
// pod_address is the pod address.
string pod_address = 3;
// validators_info is the information about the validators, indexed by address.
map<string,ValidatorInfo> validators_info = 4;
}

Expand Down
5 changes: 5 additions & 0 deletions proto/exocore/restaking_assets_manage/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import "exocore/restaking_assets_manage/v1/tx.proto";
option go_package = "github.com/ExocoreNetwork/exocore/x/restaking_assets_manage/types";

// GenesisState defines the restaking_assets_manage module's genesis state.
// TODO: make this state exportable for the case of chain restarts.
message GenesisState {
// default_supported_client_chains is the list of supported client chains,
// that are supported by default.
repeated ClientChainInfo default_supported_client_chains = 1;
// default_supported_client_chain_tokens is the list of supported client chain tokens,
// that are supported by default.
repeated AssetInfo default_supported_client_chain_tokens = 2;
}
Loading

0 comments on commit 7b9871a

Please sign in to comment.