Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix super linter config #10

Merged
merged 8 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,8 @@ jobs:
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
# previously, this ran on ref=HEAD~1, which is incorrect as it can
# only be used to compare within a branch. it is designed to run
# on a PR, so it must compare the HEAD of the base branch against
# the PR branch.
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},subdir=proto"
7 changes: 5 additions & 2 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v5
uses: super-linter/super-linter@v6.3.0 # x-release-please-version
env:
LINTER_RULES_PATH: /
YAML_CONFIG_FILE: .yamllint
Expand All @@ -33,6 +33,9 @@ jobs:
VALIDATE_NATURAL_LANGUAGE: false
VALIDATE_OPENAPI: false
VALIDATE_JSCPD: false
# separate workflow
VALIDATE_GO: false
DEFAULT_BRANCH: "master"
VALIDATE_GO_MODULES: false
# TODO: enable docker coverage later
VALIDATE_CHECKOV: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58 changes: 29 additions & 29 deletions .protolint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,35 +138,35 @@ lint:
# ## Available conventions are "lower_camel_case", "upper_snake_case", or "lower_snake_case".
# convention: upper_snake_case

# MESSAGES_HAVE_COMMENT rule option.
messages_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true

# SERVICES_HAVE_COMMENT rule option.
services_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true

# RPCS_HAVE_COMMENT rule option.
rpcs_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true

# FIELDS_HAVE_COMMENT rule option.
fields_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true

# ENUMS_HAVE_COMMENT rule option.
enums_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true

# ENUM_FIELDS_HAVE_COMMENT rule option.
enum_fields_have_comment:
# Comments need to begin with the name of the thing being described. default is false.
should_follow_golang_style: true
# # MESSAGES_HAVE_COMMENT rule option.
# messages_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # SERVICES_HAVE_COMMENT rule option.
# services_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # RPCS_HAVE_COMMENT rule option.
# rpcs_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # FIELDS_HAVE_COMMENT rule option.
# fields_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # ENUMS_HAVE_COMMENT rule option.
# enums_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # ENUM_FIELDS_HAVE_COMMENT rule option.
# enum_fields_have_comment:
# # Comments need to begin with the name of the thing being described. default is false.
# should_follow_golang_style: true

# # SYNTAX_CONSISTENT rule option.
# syntax_consistent:
Expand Down
27 changes: 22 additions & 5 deletions proto/exocore/delegation/v1/query.proto
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
syntax = "proto3";
package exocore.delegation.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/query/v1/query.proto";
import "cosmos_proto/cosmos.proto";
import "exocore/delegation/v1/tx.proto";
import "gogoproto/gogo.proto";
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
58 changes: 53 additions & 5 deletions proto/exocore/delegation/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
syntax = "proto3";
package exocore.delegation.v1;

import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "amino/amino.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"];
}
3 changes: 2 additions & 1 deletion proto/exocore/deposit/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
syntax = "proto3";
package exocore.deposit.v1;

import "google/api/annotations.proto";
import "exocore/deposit/v1/deposit.proto";
import "google/api/annotations.proto";

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

Expand All @@ -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
2 changes: 1 addition & 1 deletion proto/exocore/deposit/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package exocore.deposit.v1;

import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "exocore/deposit/v1/deposit.proto";
import "gogoproto/gogo.proto";

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

Expand Down
Loading
Loading