Skip to content

Commit

Permalink
fix: proto linter
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Apr 7, 2023
1 parent 83de081 commit 79d96f0
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 151 deletions.
8 changes: 4 additions & 4 deletions proto/mint/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ syntax = "proto3";
package mint.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";
import "mint/v1beta1/mint.proto";

option go_package = "github.com/okp4/okp4d/x/mint/types";

// GenesisState defines the mint module's genesis state.
message GenesisState {
// minter is a space for holding current inflation information.
Minter minter = 1 [(gogoproto.nullable) = false];
Minter minter = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];

// params defines all the paramaters of the module.
Params params = 2 [(gogoproto.nullable) = false];
// params defines all the parameters of the module.
Params params = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
10 changes: 6 additions & 4 deletions proto/mint/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package mint.v1beta1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "mint/v1beta1/mint.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

option go_package = "github.com/okp4/okp4d/x/mint/types";

Expand Down Expand Up @@ -33,7 +33,7 @@ message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false];
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// QueryInflationRequest is the request type for the Query/Inflation RPC method.
Expand All @@ -45,7 +45,8 @@ message QueryInflationResponse {
// inflation is the current minting inflation value.
bytes inflation = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}

Expand All @@ -59,6 +60,7 @@ message QueryAnnualProvisionsResponse {
// annual_provisions is the current minting annual provisions value.
bytes annual_provisions = 1 [
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec",
(gogoproto.nullable) = false
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true
];
}
38 changes: 25 additions & 13 deletions proto/vesting/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "vesting/v1beta1/vesting.proto";
import "cosmos_proto/cosmos.proto";
import "amino/amino.proto";

option go_package = "github.com/okp4/okp4d/x/vesting/types";

// Msg defines the bank Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

// CreateVestingAccount defines a method that enables creating a vesting
// account.
rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse);
Expand All @@ -34,13 +37,15 @@ service Msg {
// account.
message MsgCreateVestingAccount {
option (cosmos.msg.v1.signer) = "from_address";
option (amino.name) = "cosmos-sdk/MsgCreateVestingAccount";

option (gogoproto.equal) = true;

string from_address = 1;
string to_address = 2;
string from_address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
string to_address = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
repeated cosmos.base.v1beta1.Coin amount = 3 [
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];

Expand All @@ -56,12 +61,15 @@ message MsgCreateVestingAccountResponse {}
//
// Since: cosmos-sdk 0.46
message MsgCreatePermanentLockedAccount {
option (gogoproto.equal) = true;
option (cosmos.msg.v1.signer) = "from_address";
option (amino.name) = "cosmos-sdk/MsgCreatePermLockedAccount";
option (gogoproto.equal) = true;

string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated cosmos.base.v1beta1.Coin amount = 3 [
(gogoproto.nullable) = false,
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}
Expand All @@ -77,13 +85,15 @@ message MsgCreatePermanentLockedAccountResponse {}
// Since: cosmos-sdk 0.46
message MsgCreatePeriodicVestingAccount {
option (cosmos.msg.v1.signer) = "from_address";
option (amino.name) = "cosmos-sdk/MsgCreatePeriodicVestingAccount";

option (gogoproto.equal) = false;

string from_address = 1;
string to_address = 2;
int64 start_time = 3;
repeated Period vesting_periods = 4 [(gogoproto.nullable) = false];
string from_address = 1;
string to_address = 2;
// start of vesting as unix time (in seconds).
int64 start_time = 3;
repeated Period vesting_periods = 4 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount
Expand All @@ -96,13 +106,15 @@ message MsgCreatePeriodicVestingAccountResponse {}
// account.
message MsgCreateCliffVestingAccount {
option (cosmos.msg.v1.signer) = "from_address";
option (amino.name) = "cosmos-sdk/MsgCreateCliffVestingAccount";

option (gogoproto.equal) = true;

string from_address = 1;
string to_address = 2;
string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""];
string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""];
repeated cosmos.base.v1beta1.Coin amount = 3 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];

Expand Down
15 changes: 14 additions & 1 deletion proto/vesting/v1beta1/vesting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ syntax = "proto3";

package vesting.v1beta1;

import "amino/amino.proto";
import "cosmos/auth/v1beta1/auth.proto";
import "cosmos/base/v1beta1/coin.proto";
import "gogoproto/gogo.proto";
Expand All @@ -12,39 +13,47 @@ option go_package = "github.com/okp4/okp4d/x/vesting/types";
// BaseVestingAccount implements the VestingAccount interface. It contains all
// the necessary fields needed for any vesting account implementation.
message BaseVestingAccount {
option (amino.name) = "cosmos-sdk/BaseVestingAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true];
repeated cosmos.base.v1beta1.Coin original_vesting = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
repeated cosmos.base.v1beta1.Coin delegated_free = 3 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
// Vesting end time, as unix timestamp (in seconds).
int64 end_time = 5;
}

// ContinuousVestingAccount implements the VestingAccount interface. It
// continuously vests by unlocking coins linearly with respect to time.
message ContinuousVestingAccount {
option (amino.name) = "cosmos-sdk/ContinuousVestingAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
// Vesting start time, as unix timestamp (in seconds).
int64 start_time = 2;
}

// DelayedVestingAccount implements the VestingAccount interface. It vests all
// coins after a specific time, but non prior. In other words, it keeps them
// locked until a specified time.
message DelayedVestingAccount {
option (amino.name) = "cosmos-sdk/DelayedVestingAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

Expand All @@ -58,19 +67,21 @@ message Period {
int64 length = 1;
repeated cosmos.base.v1beta1.Coin amount = 2 [
(gogoproto.nullable) = false,
(amino.dont_omitempty) = true,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"
];
}

// PeriodicVestingAccount implements the VestingAccount interface. It
// periodically vests by unlocking coins during each specified period.
message PeriodicVestingAccount {
option (amino.name) = "cosmos-sdk/PeriodicVestingAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true];
int64 start_time = 2;
repeated Period vesting_periods = 3 [(gogoproto.nullable) = false];
repeated Period vesting_periods = 3 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// PermanentLockedAccount implements the VestingAccount interface. It does
Expand All @@ -79,6 +90,7 @@ message PeriodicVestingAccount {
//
// Since: cosmos-sdk 0.43
message PermanentLockedAccount {
option (amino.name) = "cosmos-sdk/PermanentLockedAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

Expand All @@ -88,6 +100,7 @@ message PermanentLockedAccount {
// CliffVestingAccount implements the VestingAccount interface. It
// continuously vests by unlocking coins after a cliff period linearly with respect to time.
message CliffVestingAccount {
option (amino.name) = "cosmos-sdk/CliffVestingAccount";
option (gogoproto.goproto_getters) = false;
option (gogoproto.goproto_stringer) = false;

Expand Down
28 changes: 14 additions & 14 deletions x/mint/types/genesis.pb.go

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

62 changes: 31 additions & 31 deletions x/mint/types/query.pb.go

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

Loading

0 comments on commit 79d96f0

Please sign in to comment.