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

fix proto-lint and lint some protobufs #226

Merged
merged 2 commits into from
Jul 12, 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
1 change: 1 addition & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ignore:
- "**/cli"
- "**/rest"
- "**/*.pb.go"
- "**/*.pulsar.go"
- "**/*.pb.gw.go"
- "**/test_utils.go"
- "**/module.go"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

proto-lint:
@$(protoImage) buf lint --error-format=json
@$(protoImage) buf lint --error-format=json ./proto

proto-check-breaking:
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main
Expand Down
2 changes: 2 additions & 0 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ lint:
- SERVICE_SUFFIX
- PACKAGE_VERSION_SUFFIX
- RPC_REQUEST_STANDARD_NAME
- ENUM_VALUE_PREFIX
- ENUM_ZERO_VALUE_SUFFIX
1 change: 0 additions & 1 deletion proto/ibc/applications/nft_transfer/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ syntax = "proto3";
package ibc.applications.nft_transfer.v1;

import "amino/amino.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
Expand Down
1 change: 0 additions & 1 deletion proto/ibc/applications/nft_transfer/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ option go_package = "github.com/initia-labs/initia/x/ibc/nft-transfer/types";

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

// ClassTrace contains the base class id for ICS721 non fungible tokens and the
// source tracing information path.
Expand Down
3 changes: 2 additions & 1 deletion proto/ibc/applications/perm/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ option go_package = "github.com/initia-labs/initia/x/ibc/perm/types";
// Query provides defines the gRPC querier service.
service Query {
// PermissionedRelayersByChannel queries a set of permissioned ibc relayers for the specific channel.
rpc PermissionedRelayersByChannel(QueryPermissionedRelayersByChannelRequest) returns (QueryPermissionedRelayersByChannelResponse) {
rpc PermissionedRelayersByChannel(QueryPermissionedRelayersByChannelRequest)
returns (QueryPermissionedRelayersByChannelResponse) {
option (google.api.http).get = "/ibc/apps/perm/v1/relayers/{port_id}/{channel_id}";
}

Expand Down
8 changes: 1 addition & 7 deletions proto/ibc/applications/perm/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "amino/amino.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";
import "gogoproto/gogo.proto";
import "ibc/applications/perm/v1/types.proto";
option go_package = "github.com/initia-labs/initia/x/ibc/perm/types";

// Msg defines the ibc/perm Msg service
Expand All @@ -14,7 +13,6 @@ service Msg {

// SetPermissionedRelayers defines a rpc handler method for MsgSetPermissionedRelayers.
rpc SetPermissionedRelayers(MsgSetPermissionedRelayers) returns (MsgSetPermissionedRelayersResponse);

}

// MsgSetPermissionedRelayers defines msg to set permissioned relyer for
Expand All @@ -31,12 +29,8 @@ message MsgSetPermissionedRelayers {
string authority = 1 [(gogoproto.moretags) = "yaml:\"authority\"", (cosmos_proto.scalar) = "cosmos.AddressString"];
string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""];
string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""];
repeated string relayers = 4 [(gogoproto.moretags) = "yaml:\"relayers\""];
repeated string relayers = 4 [(gogoproto.moretags) = "yaml:\"relayers\""];
}

// MsgSetPermissionedRelayersResponse defines the Msg/SetPermissionedRelayer response type.
message MsgSetPermissionedRelayersResponse {}




8 changes: 5 additions & 3 deletions proto/ibc/applications/perm/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ option go_package = "github.com/initia-labs/initia/x/ibc/perm/types";
// PermissionedRelayer is used to specifiy the permissioned relayer for
// the specific port-id:channel-id pair.
message PermissionedRelayers {
string port_id = 1;
string channel_id = 2;
repeated string relayers = 3;
string port_id = 1;
string channel_id = 2;
repeated string relayers = 3;
}

// PermissionedRelayersList is used to specify the list of permissioned relayers
// for the specific port-id:channel-id pair.
message PermissionedRelayersList {
repeated string relayers = 1;
}
1 change: 0 additions & 1 deletion proto/initia/distribution/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ option go_package = "github.com/initia-labs/initia/x/distribution/typ
option (gogoproto.equal_all) = true;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos/distribution/v1beta1/distribution.proto";
import "cosmos/distribution/v1beta1/genesis.proto";
import "initia/distribution/v1/distribution.proto";
Expand Down
1 change: 0 additions & 1 deletion proto/initia/distribution/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package initia.distribution.v1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

import "cosmos/base/v1beta1/coin.proto";
import "cosmos/base/query/v1beta1/pagination.proto";

import "initia/distribution/v1/distribution.proto";
Expand Down
3 changes: 0 additions & 3 deletions proto/initia/gov/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ syntax = "proto3";

package initia.gov.v1;

import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "cosmos/gov/v1/gov.proto";
import "initia/gov/v1/gov.proto";
import "amino/amino.proto";

option go_package = "github.com/initia-labs/initia/x/gov/types";

Expand Down
2 changes: 0 additions & 2 deletions proto/initia/gov/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ package initia.gov.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "cosmos/gov/v1/gov.proto";
import "amino/amino.proto";
import "initia/gov/v1/gov.proto";

option go_package = "github.com/initia-labs/initia/x/gov/types";
Expand Down
15 changes: 7 additions & 8 deletions proto/initia/move/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,15 @@ message TableEntry {
bytes value_bytes = 5;
}

// UpgradePolicy
// * `compatible`
// Whether a compatibility check should be performed for upgrades. The check only passes if
// a new module has (a) the same public functions (b) for existing resources, no layout change.
// * `immutable`
// Whether the modules in the package are immutable and cannot be upgraded.
// UpgradePolicy is the policy for upgrading a move module.
enum UpgradePolicy {
// UNSPECIFIED: a placeholder for an unspecified upgrade policy.
UNSPECIFIED = 0;
COMPATIBLE = 1;
IMMUTABLE = 2;
// COMPATBILE: Whether a compatibility check should be performed for upgrades. The check only passes if
// a new module has (a) the same public functions (b) for existing resources, no layout change.
COMPATIBLE = 1;
// IMMUTABLE: Whether the modules in the package are immutable and cannot be upgraded.
IMMUTABLE = 2;
}

// proto wrapper to store the value
Expand Down
1 change: 0 additions & 1 deletion proto/initia/mstaking/v1/staking.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "tendermint/types/types.proto";

option go_package = "github.com/initia-labs/initia/x/mstaking/types";

Expand Down
1 change: 1 addition & 0 deletions proto/initia/reward/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ option go_package = "github.com/initia-labs/initia/x/reward/types";
service Msg {
option (cosmos.msg.v1.service) = true;

// UpdateParams defines a rpc handler method for MsgUpdateParams.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
}

Expand Down
128 changes: 63 additions & 65 deletions x/distribution/types/genesis.pb.go

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

Loading
Loading