Skip to content

Commit

Permalink
Revert "lint protos"
Browse files Browse the repository at this point in the history
This reverts commit d2b80c4.
  • Loading branch information
asalzmann committed Jul 25, 2022
1 parent d2b80c4 commit d2157eb
Show file tree
Hide file tree
Showing 19 changed files with 259 additions and 323 deletions.
31 changes: 0 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,6 @@ clean-state:
lint:
golangci-lint run


###############################################################################
### Proto ###
###############################################################################

proto-all: proto-format proto-gen

proto:
@echo
@echo "=========== Generate Message ============"
@echo
./scripts/protocgen.sh
@echo
@echo "=========== Generate Complete ============"
@echo

protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=cosmos-sdk-proto-gen-$(protoVer)
containerProtoFmt=cosmos-sdk-proto-fmt-$(protoVer)

proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protocgen.sh; fi

proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
find ./ -not -path "./third_party/*" -name "*.proto" -exec clang-format -i {} \; ; fi

###############################################################################
### Tests ###
###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/cosmos/cosmos-proto v1.0.0-alpha7
github.com/cosmos/cosmos-sdk v0.45.6
github.com/cosmos/cosmos-sdk v0.45.4
github.com/cosmos/ibc-go/v3 v3.1.0
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
Expand Down
7 changes: 3 additions & 4 deletions proto/epochs/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ service Query {
option (google.api.http).get = "/Stridelabs/stride/epochs/current_epoch";
}
// CurrentEpoch provide current epoch of specified identifier
rpc EpochInfo(QueryEpochInfoRequest) returns (QueryEpochInfoResponse) {
rpc EpochInfo(QueryEpochInfoRequest)
returns (QueryEpochInfoResponse) {
option (google.api.http).get = "/Stridelabs/stride/epochs/epoch_info";
}
}
Expand All @@ -38,9 +39,7 @@ message QueryCurrentEpochRequest { string identifier = 1; }
message QueryCurrentEpochResponse { int64 current_epoch = 1; }

message QueryEpochInfoRequest { string identifier = 1; }
message QueryEpochInfoResponse {
EpochInfo epoch = 1 [ (gogoproto.nullable) = false ];
}
message QueryEpochInfoResponse { EpochInfo epoch = 1 [ (gogoproto.nullable) = false ]; }

// syntax = "proto3";
// package Stridelabs.stride.epochs;
Expand Down
3 changes: 1 addition & 2 deletions proto/interchainquery/v1/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ message MsgSubmitQueryResponse {
string chain_id = 1 [ (gogoproto.moretags) = "yaml:\"chain_id\"" ];
string query_id = 2 [ (gogoproto.moretags) = "yaml:\"query_id\"" ];
bytes result = 3 [ (gogoproto.moretags) = "yaml:\"result\"" ];
tendermint.crypto.ProofOps proof_ops = 4
[ (gogoproto.moretags) = "yaml:\"proof_ops\"" ];
tendermint.crypto.ProofOps proof_ops = 4 [ (gogoproto.moretags) = "yaml:\"proof_ops\"" ];
int64 height = 5 [ (gogoproto.moretags) = "yaml:\"height\"" ];
string from_address = 6 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
}
Expand Down
6 changes: 3 additions & 3 deletions proto/mint/v1beta1/mint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ message DistributionProportions {
(gogoproto.moretags) = "yaml:\"pool_incentives\"",
(gogoproto.nullable) = false
];
// participation_rewards defines the proportion of the minted minted_denom
// that is to be allocated to participation rewards address.
// participation_rewards defines the proportion of the minted minted_denom that is
// to be allocated to participation rewards address.
string participation_rewards = 3 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.moretags) = "yaml:\"participation_rewards\"",
Expand Down Expand Up @@ -77,7 +77,7 @@ message Params {
DistributionProportions distribution_proportions = 6
[ (gogoproto.nullable) = false ];

// start epoch to distribute minting rewards
// start epoch to distribute minting rewards
int64 minting_rewards_distribution_start_epoch = 7
[ (gogoproto.moretags) =
"yaml:\"minting_rewards_distribution_start_epoch\"" ];
Expand Down
53 changes: 31 additions & 22 deletions proto/records/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,52 @@ import "google/protobuf/timestamp.proto";

option go_package = "github.com/Stride-Labs/stride/x/records/types";


message UserRedemptionRecord {
string id = 1; // {chain_id}.{epoch}.{sender}
string sender = 2;
string receiver = 3;
uint64 amount = 4;
string denom = 5;
string hostZoneId = 6;
int64 epochNumber = 7;
bool isClaimable = 8;
string sender = 2;
string receiver = 3;
uint64 amount = 4;
string denom = 5;
string hostZoneId = 6;
int64 epochNumber = 7;
bool isClaimable = 8;
}


// Msg defines the Msg service.
service Msg {
// this line is used by starport scaffolding # proto/tx/rpc
}

// this line is used by starport scaffolding # proto/tx/message


// Params defines the parameters for the module.
message Params { option (gogoproto.goproto_stringer) = false; }
message Params {
option (gogoproto.goproto_stringer) = false;

}


message RecordsPacketData {
oneof packet {
NoData noData = 1;
// this line is used by starport scaffolding # ibc/packet/proto/field
NoData noData = 1;
// this line is used by starport scaffolding # ibc/packet/proto/field
}
}

message NoData {}
message NoData {
}

// this line is used by starport scaffolding # ibc/packet/proto/message


message DepositRecord {
uint64 id = 1;
int64 amount = 2;
string denom = 3;
string hostZoneId = 4;
string hostZoneId = 4;
enum Status {
// pending transfer to delegate account
TRANSFER = 0;
Expand All @@ -62,6 +71,7 @@ message DepositRecord {
reserved 5;
}


message HostZoneUnbonding {
enum Status {
// tokens bonded on delegate account
Expand All @@ -79,11 +89,9 @@ message HostZoneUnbonding {
uint64 unbondingTime = 5;
Status status = 4;
// google.protobuf.Timestamp unbondingTime = 5
// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true,
// (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// google.protobuf.Timestamp completionTime = 5
// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true,
// (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""];
// Index UserRedemptionRecords here (note: id is {chain_id}.{epoch}.{sender})
repeated string userRedemptionRecords = 6;
}
Expand All @@ -95,18 +103,19 @@ message EpochUnbondingRecord {
map<string, HostZoneUnbonding> hostZoneUnbondings = 3;
}


// GenesisState defines the recordπs module's genesis state.
// next id: 9
message GenesisState {
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];
string port_id = 2;
repeated UserRedemptionRecord userRedemptionRecordList = 3
[ (gogoproto.nullable) = false ];
repeated UserRedemptionRecord userRedemptionRecordList = 3 [(gogoproto.nullable) = false];
uint64 userRedemptionRecordCount = 4;
repeated EpochUnbondingRecord epochUnbondingRecordList = 5
[ (gogoproto.nullable) = false ];
repeated EpochUnbondingRecord epochUnbondingRecordList = 5 [(gogoproto.nullable) = false];
uint64 epochUnbondingRecordCount = 6;
repeated DepositRecord depositRecordList = 7 [ (gogoproto.nullable) = false ];
repeated DepositRecord depositRecordList = 7 [(gogoproto.nullable) = false];
uint64 depositRecordCount = 8;
// this line is used by starport scaffolding # genesis/proto/state
}


114 changes: 53 additions & 61 deletions proto/records/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,37 @@ service Query {
option (google.api.http).get = "/StrideLabs/stride/records/params";
}
// Queries a UserRedemptionRecord by id.
rpc UserRedemptionRecord(QueryGetUserRedemptionRecordRequest)
returns (QueryGetUserRedemptionRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/user_redemption_record/{id}";
}

// Queries a list of UserRedemptionRecord items.
rpc UserRedemptionRecordAll(QueryAllUserRedemptionRecordRequest)
returns (QueryAllUserRedemptionRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/user_redemption_record";
}

// Queries a EpochUnbondingRecord by id.
rpc EpochUnbondingRecord(QueryGetEpochUnbondingRecordRequest)
returns (QueryGetEpochUnbondingRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/epoch_unbonding_record/{id}";
}

// Queries a list of EpochUnbondingRecord items.
rpc EpochUnbondingRecordAll(QueryAllEpochUnbondingRecordRequest)
returns (QueryAllEpochUnbondingRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/epoch_unbonding_record";
}

// this line is used by starport scaffolding # 2

rpc UserRedemptionRecord(QueryGetUserRedemptionRecordRequest) returns (QueryGetUserRedemptionRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/user_redemption_record/{id}";
}

// Queries a list of UserRedemptionRecord items.
rpc UserRedemptionRecordAll(QueryAllUserRedemptionRecordRequest) returns (QueryAllUserRedemptionRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/user_redemption_record";
}

// Queries a EpochUnbondingRecord by id.
rpc EpochUnbondingRecord(QueryGetEpochUnbondingRecordRequest) returns (QueryGetEpochUnbondingRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/epoch_unbonding_record/{id}";
}

// Queries a list of EpochUnbondingRecord items.
rpc EpochUnbondingRecordAll(QueryAllEpochUnbondingRecordRequest) returns (QueryAllEpochUnbondingRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/epoch_unbonding_record";
}

// this line is used by starport scaffolding # 2

// Queries a DepositRecord by id.
rpc DepositRecord(QueryGetDepositRecordRequest)
returns (QueryGetDepositRecordResponse) {
option (google.api.http).get =
"/Stride-Labs/stride/records/deposit_record/{id}";
}

// Queries a list of DepositRecord items.
rpc DepositRecordAll(QueryAllDepositRecordRequest)
returns (QueryAllDepositRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/deposit_record";
}
// this line is used by starport scaffolding # 2
rpc DepositRecord(QueryGetDepositRecordRequest) returns (QueryGetDepositRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/deposit_record/{id}";
}

// Queries a list of DepositRecord items.
rpc DepositRecordAll(QueryAllDepositRecordRequest) returns (QueryAllDepositRecordResponse) {
option (google.api.http).get = "/Stride-Labs/stride/records/deposit_record";
}
// this line is used by starport scaffolding # 2
}

// QueryParamsRequest is request type for the Query/Params RPC method.
Expand All @@ -66,56 +55,59 @@ message QueryParamsRequest {}
// QueryParamsResponse is response type for the Query/Params RPC method.
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [ (gogoproto.nullable) = false ];
Params params = 1 [(gogoproto.nullable) = false];

}

message QueryGetDepositRecordRequest { uint64 id = 1; }
message QueryGetDepositRecordRequest {
uint64 id = 1;
}

message QueryGetDepositRecordResponse {
DepositRecord DepositRecord = 1 [ (gogoproto.nullable) = false ];
DepositRecord DepositRecord = 1 [(gogoproto.nullable) = false];
}

message QueryAllDepositRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllDepositRecordResponse {
repeated DepositRecord DepositRecord = 1 [ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated DepositRecord DepositRecord = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetUserRedemptionRecordRequest { string id = 1; }
message QueryGetUserRedemptionRecordRequest {
string id = 1;
}

message QueryGetUserRedemptionRecordResponse {
UserRedemptionRecord UserRedemptionRecord = 1
[ (gogoproto.nullable) = false ];
UserRedemptionRecord UserRedemptionRecord = 1 [(gogoproto.nullable) = false];
}

message QueryAllUserRedemptionRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllUserRedemptionRecordResponse {
repeated UserRedemptionRecord UserRedemptionRecord = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated UserRedemptionRecord UserRedemptionRecord = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

message QueryGetEpochUnbondingRecordRequest { uint64 id = 1; }
message QueryGetEpochUnbondingRecordRequest {
uint64 id = 1;
}

message QueryGetEpochUnbondingRecordResponse {
EpochUnbondingRecord EpochUnbondingRecord = 1
[ (gogoproto.nullable) = false ];
EpochUnbondingRecord EpochUnbondingRecord = 1 [(gogoproto.nullable) = false];
}

message QueryAllEpochUnbondingRecordRequest {
cosmos.base.query.v1beta1.PageRequest pagination = 1;
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}

message QueryAllEpochUnbondingRecordResponse {
repeated EpochUnbondingRecord EpochUnbondingRecord = 1
[ (gogoproto.nullable) = false ];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
repeated EpochUnbondingRecord EpochUnbondingRecord = 1 [(gogoproto.nullable) = false];
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

// this line is used by starport scaffolding # 3
6 changes: 3 additions & 3 deletions proto/stakeibc/delegation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "stakeibc/validator.proto";
option go_package = "github.com/Stride-Labs/stride/x/stakeibc/types";

message Delegation {
string delegateAcctAddress = 1;
Validator validator = 2;
int64 amt = 3;
string delegateAcctAddress = 1;
Validator validator = 2;
int64 amt = 3;
}
3 changes: 2 additions & 1 deletion proto/stakeibc/epoch_tracker.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ package Stridelabs.stride.stakeibc;
option go_package = "github.com/Stride-Labs/stride/x/stakeibc/types";

message EpochTracker {
string epochIdentifier = 1;
string epochIdentifier = 1;
uint64 epochNumber = 2;
int64 nextEpochStartTime = 3;
int64 duration = 4;
}

Loading

0 comments on commit d2157eb

Please sign in to comment.