Skip to content

Commit

Permalink
fix proto-lint and run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Vritra4 committed Jul 12, 2024
1 parent 0ab1ecc commit b562b06
Show file tree
Hide file tree
Showing 11 changed files with 570 additions and 170 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";
package miniwasm.tokenfactory.v1;

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

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

Expand Down
2 changes: 1 addition & 1 deletion proto/miniwasm/tokenfactory/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";
package miniwasm.tokenfactory.v1;

import "gogoproto/gogo.proto";
import "miniwasm/tokenfactory/v1/authorityMetadata.proto";
import "miniwasm/tokenfactory/v1/authority_metadata.proto";
import "miniwasm/tokenfactory/v1/params.proto";

option go_package = "github.com/initia-labs/miniwasm/x/tokenfactory/types";
Expand Down
2 changes: 0 additions & 2 deletions proto/miniwasm/tokenfactory/v1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ syntax = "proto3";
package miniwasm.tokenfactory.v1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/base/v1beta1/coin.proto";
import "miniwasm/tokenfactory/v1/authorityMetadata.proto";

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

Expand Down
5 changes: 3 additions & 2 deletions proto/miniwasm/tokenfactory/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ package miniwasm.tokenfactory.v1;

import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "miniwasm/tokenfactory/v1/authorityMetadata.proto";
import "miniwasm/tokenfactory/v1/authority_metadata.proto";
import "miniwasm/tokenfactory/v1/params.proto";

option go_package = "github.com/initia-labs/miniwasm/x/tokenfactory/types";
Expand Down Expand Up @@ -78,6 +77,8 @@ message QueryDenomsFromCreatorResponse {
repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ];
}

// QueryBeforeSendHookAddressRequest defines the request structure for the
// BeforeSendHookAddress gRPC query.
message QueryBeforeSendHookAddressRequest {
string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
}
Expand Down
34 changes: 30 additions & 4 deletions proto/miniwasm/tokenfactory/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,33 @@ option go_package = "github.com/initia-labs/miniwasm/x/tokenfactory/types";
service Msg {
option (cosmos.msg.v1.service) = true;

// CreateDenom defines a gRPC service method for creating a new denom.
rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse);

// Mint defines a gRPC service method for minting more of a token.
rpc Mint(MsgMint) returns (MsgMintResponse);

// Burn defines a gRPC service method for burning a token.
rpc Burn(MsgBurn) returns (MsgBurnResponse);

// ChangeAdmin defines a gRPC service method for changing the admin of a
// denom.
rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse);

// SetDenomMetadata defines a gRPC service method for setting the metadata of
// a denom.
rpc SetDenomMetadata(MsgSetDenomMetadata)
returns (MsgSetDenomMetadataResponse);

// SetBeforeSendHook defines a gRPC service method for setting the before send
// hook of a denom.
rpc SetBeforeSendHook(MsgSetBeforeSendHook)
returns (MsgSetBeforeSendHookResponse);

// ForceTransfer defines a gRPC service method for transferring a token from
// one account to another.
rpc ForceTransfer(MsgForceTransfer) returns (MsgForceTransferResponse);

// UpdateParams defines an operation for updating the x/tokenfactory module
// parameters.
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
Expand Down Expand Up @@ -68,12 +86,14 @@ message MsgMint {
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
string mintToAddress = 3 [
string mint_to_address = 3 [
(gogoproto.moretags) = "yaml:\"mint_to_address\"",
(amino.dont_omitempty) = true
];
}

// MsgMintResponse defines the response structure for an executed
// MsgMint message.
message MsgMintResponse {}

// MsgBurn is the sdk.Msg type for allowing an admin account to burn
Expand All @@ -89,12 +109,14 @@ message MsgBurn {
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
string burnFromAddress = 3 [
string burn_from_address = 3 [
(gogoproto.moretags) = "yaml:\"burn_from_address\"",
(amino.dont_omitempty) = true
];
}

// MsgBurnResponse defines the response structure for an executed
// MsgBurn message.
message MsgBurnResponse {}

// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
Expand Down Expand Up @@ -147,6 +169,8 @@ message MsgSetDenomMetadata {
// MsgSetDenomMetadata message.
message MsgSetDenomMetadataResponse {}

// MsgForceTransfer is the sdk.Msg type for allowing an admin account to
// transfer a token from one account to another
message MsgForceTransfer {
option (cosmos.msg.v1.signer) = "sender";
option (amino.name) = "tokenfactory/MsgForceTransfer";
Expand All @@ -156,12 +180,14 @@ message MsgForceTransfer {
(gogoproto.moretags) = "yaml:\"amount\"",
(gogoproto.nullable) = false
];
string transferFromAddress = 3
string transfer_from_address = 3
[ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
string transferToAddress = 4
string transfer_to_address = 4
[ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ];
}

// MsgForceTransferResponse defines the response structure for an executed
// MsgForceTransfer message.
message MsgForceTransferResponse {}

// MsgUpdateParams is the Msg/UpdateParams request type.
Expand Down
Loading

0 comments on commit b562b06

Please sign in to comment.