Skip to content

Commit

Permalink
feat: Removed service word in proto services (#677)
Browse files Browse the repository at this point in the history
  • Loading branch information
gyuguen authored Mar 13, 2024
1 parent c63aafd commit 099f253
Show file tree
Hide file tree
Showing 33 changed files with 1,236 additions and 1,236 deletions.
26 changes: 13 additions & 13 deletions proto/panacea/aol/v2/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,33 @@ option java_multiple_files = true;
option go_package = "github.com/medibloc/panacea-core/x/aol/types";

// Msg defines the Msg service.
service MsgService {
service Msg {
// CreateTopic defines a method for creating a topic.
rpc CreateTopic(MsgServiceCreateTopicRequest) returns (MsgServiceCreateTopicResponse);
rpc CreateTopic(MsgCreateTopicRequest) returns (MsgCreateTopicResponse);

// AddWriter defines a method for adding a writer to the topic.
rpc AddWriter(MsgServiceAddWriterRequest) returns (MsgServiceAddWriterResponse);
rpc AddWriter(MsgAddWriterRequest) returns (MsgAddWriterResponse);

// DeleteWriter defines a method for deleting a writer to the topic.
rpc DeleteWriter(MsgServiceDeleteWriterRequest) returns (MsgServiceDeleteWriterResponse);
rpc DeleteWriter(MsgDeleteWriterRequest) returns (MsgDeleteWriterResponse);

// AddRecord defines a method for adding a record to the topic with the
// writer.
rpc AddRecord(MsgServiceAddRecordRequest) returns (MsgServiceAddRecordResponse);
rpc AddRecord(MsgAddRecordRequest) returns (MsgAddRecordResponse);
}

// MsgCreateTopic defines the Msg/CreateTopic request type.
message MsgServiceCreateTopicRequest {
message MsgCreateTopicRequest {
string topic_name = 1;
string description = 2;
string owner_address = 3;
}

// MsgCreateTopicResponse defines the Msg/CreateTopic response type.
message MsgServiceCreateTopicResponse {}
message MsgCreateTopicResponse {}

// MsgAddWriter defines the Msg/AddWriter request type.
message MsgServiceAddWriterRequest {
message MsgAddWriterRequest {
string topic_name = 1;
string moniker = 2;
string description = 3;
Expand All @@ -40,20 +40,20 @@ message MsgServiceAddWriterRequest {
}

// MsgAddWriter defines the Msg/AddWriter response type.
message MsgServiceAddWriterResponse {}
message MsgAddWriterResponse {}

// MsgDeleteWriter defines the Msg/DeleteWriter request type.
message MsgServiceDeleteWriterRequest {
message MsgDeleteWriterRequest {
string topic_name = 1;
string writer_address = 2;
string owner_address = 3;
}

// MsgDeleteWriter defines the Msg/DeleteWriter response type.
message MsgServiceDeleteWriterResponse {}
message MsgDeleteWriterResponse {}

// MsgAddRecord defines the Msg/AddRecord request type.
message MsgServiceAddRecordRequest {
message MsgAddRecordRequest {
string topic_name = 1;
bytes key = 2;
bytes value = 3;
Expand All @@ -63,7 +63,7 @@ message MsgServiceAddRecordRequest {
}

// MsgAddRecordResponse defines the Msg/AddRecordResponse response type.
message MsgServiceAddRecordResponse {
message MsgAddRecordResponse {
string owner_address = 1;
string topic_name = 2;
uint64 offset = 3;
Expand Down
20 changes: 10 additions & 10 deletions proto/panacea/did/v2/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ option go_package = "github.com/medibloc/panacea-core/x/did/types";
import "panacea/did/v2/did.proto";

// Msg defines the Msg service.
service MsgService {
service Msg {
// CreateDID defines a method for creating a DID.
rpc CreateDID(MsgServiceCreateDIDRequest) returns (MsgServiceCreateDIDResponse);
rpc CreateDID(MsgCreateDIDRequest) returns (MsgCreateDIDResponse);

// UpdateDID defines a method for updating a DID.
rpc UpdateDID(MsgServiceUpdateDIDRequest) returns (MsgServiceUpdateDIDResponse);
rpc UpdateDID(MsgUpdateDIDRequest) returns (MsgUpdateDIDResponse);

// DeactivateDID defines a method for deactivating a DID.
rpc DeactivateDID(MsgServiceDeactivateDIDRequest) returns (MsgServiceDeactivateDIDResponse);
rpc DeactivateDID(MsgDeactivateDIDRequest) returns (MsgDeactivateDIDResponse);
}

// MsgCreateDID defines the Msg/CreateDID request type.
message MsgServiceCreateDIDRequest {
message MsgCreateDIDRequest {
string did = 1;
DIDDocument document = 2;
string verification_method_id = 3;
Expand All @@ -28,10 +28,10 @@ message MsgServiceCreateDIDRequest {
}

// MsgCreateDIDResponse defines the Msg/CreateDID response type.
message MsgServiceCreateDIDResponse {}
message MsgCreateDIDResponse {}

// MsgUpdateDID defines the Msg/UpdateDID request type.
message MsgServiceUpdateDIDRequest {
message MsgUpdateDIDRequest {
string did = 1;
DIDDocument document = 2;
string verification_method_id = 3;
Expand All @@ -40,15 +40,15 @@ message MsgServiceUpdateDIDRequest {
}

// MsgUpdateDIDResponse defines the Msg/UpdateDID response type.
message MsgServiceUpdateDIDResponse {}
message MsgUpdateDIDResponse {}

// MsgDeactivateDID defines the Msg/DeactivateDID request type.
message MsgServiceDeactivateDIDRequest {
message MsgDeactivateDIDRequest {
string did = 1;
string verification_method_id = 2;
bytes signature = 3;
string from_address = 4;
}

// MsgDeactivateDIDResponse defines the Msg/DeactivateDID response type.
message MsgServiceDeactivateDIDResponse {}
message MsgDeactivateDIDResponse {}
44 changes: 22 additions & 22 deletions proto/panacea/pnft/v2/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ package panacea.pnft.v2;
option go_package = "github.com/medibloc/panacea-core/x/pnft/types";
option java_multiple_files = true;

service MsgService {
rpc CreateDenom(MsgServiceCreateDenomRequest) returns (MsgServiceCreateDenomResponse);
service Msg {
rpc CreateDenom(MsgCreateDenomRequest) returns (MsgCreateDenomResponse);

rpc UpdateDenom(MsgServiceUpdateDenomRequest) returns (MsgServiceUpdateDenomResponse);
rpc UpdateDenom(MsgUpdateDenomRequest) returns (MsgUpdateDenomResponse);

rpc DeleteDenom(MsgServiceDeleteDenomRequest) returns (MsgServiceDeleteDenomResponse);
rpc DeleteDenom(MsgDeleteDenomRequest) returns (MsgDeleteDenomResponse);

rpc TransferDenom(MsgServiceTransferDenomRequest) returns (MsgServiceTransferDenomResponse);
rpc TransferDenom(MsgTransferDenomRequest) returns (MsgTransferDenomResponse);

rpc MintPNFT(MsgServiceMintPNFTRequest) returns (MsgServiceMintPNFTResponse);
rpc MintPNFT(MsgMintPNFTRequest) returns (MsgMintPNFTResponse);

rpc TransferPNFT(MsgServiceTransferPNFTRequest) returns (MsgServiceTransferPNFTResponse);
rpc TransferPNFT(MsgTransferPNFTRequest) returns (MsgTransferPNFTResponse);

rpc BurnPNFT(MsgServiceBurnPNFTRequest) returns (MsgServiceBurnPNFTResponse);
rpc BurnPNFT(MsgBurnPNFTRequest) returns (MsgBurnPNFTResponse);
}

message MsgServiceCreateDenomRequest {
message MsgCreateDenomRequest {
string id = 1;
string name = 2;
string symbol = 3;
Expand All @@ -31,9 +31,9 @@ message MsgServiceCreateDenomRequest {
string creator = 8;
}

message MsgServiceCreateDenomResponse {}
message MsgCreateDenomResponse {}

message MsgServiceUpdateDenomRequest {
message MsgUpdateDenomRequest {
string id = 1;
string name = 2;
string symbol = 3;
Expand All @@ -44,24 +44,24 @@ message MsgServiceUpdateDenomRequest {
string updater = 8;
}

message MsgServiceUpdateDenomResponse {}
message MsgUpdateDenomResponse {}

message MsgServiceDeleteDenomRequest {
message MsgDeleteDenomRequest {
string id = 1;
string remover = 2;
}

message MsgServiceDeleteDenomResponse {}
message MsgDeleteDenomResponse {}

message MsgServiceTransferDenomRequest {
message MsgTransferDenomRequest {
string id = 1;
string sender = 2;
string receiver = 3;
}

message MsgServiceTransferDenomResponse {}
message MsgTransferDenomResponse {}

message MsgServiceMintPNFTRequest {
message MsgMintPNFTRequest {
string denom_id = 1;
string id = 2;
string name = 3;
Expand All @@ -72,21 +72,21 @@ message MsgServiceMintPNFTRequest {
string creator = 8;
}

message MsgServiceMintPNFTResponse {}
message MsgMintPNFTResponse {}

message MsgServiceTransferPNFTRequest {
message MsgTransferPNFTRequest {
string denom_id = 1;
string id = 2;
string sender = 3;
string receiver = 4;
}

message MsgServiceTransferPNFTResponse {}
message MsgTransferPNFTResponse {}

message MsgServiceBurnPNFTRequest {
message MsgBurnPNFTRequest {
string denom_id = 1;
string id = 2;
string burner = 3;
}

message MsgServiceBurnPNFTResponse {}
message MsgBurnPNFTResponse {}
4 changes: 2 additions & 2 deletions types/testsuite/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ type TestSuite struct {
AccountKeeper authkeeper.AccountKeeper
StakingKeeper *stakingkeeper.Keeper
AolKeeper aolkeeper.Keeper
AolMsgServer aoltypes.MsgServiceServer
AolMsgServer aoltypes.MsgServer
BankKeeper bankkeeper.Keeper
BurnKeeper burnkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
DistrKeeper distrkeeper.Keeper
IBCKeeper *ibckeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
DIDMsgServer didtypes.MsgServiceServer
DIDMsgServer didtypes.MsgServer
DIDKeeper didkeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
}
Expand Down
2 changes: 1 addition & 1 deletion x/aol/client/cli/txRecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func CmdAddRecord() *cobra.Command {
writerAddress := clientCtx.GetFromAddress().String()
feePayerAddress := viper.GetString(flagFeePayer)

msg := types.NewMsgServiceAddRecordRequest(topicName, key, value, writerAddress, ownerAddress, feePayerAddress)
msg := types.NewMsgAddRecordRequest(topicName, key, value, writerAddress, ownerAddress, feePayerAddress)
if err := msg.ValidateBasic(); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions x/aol/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ type msgServer struct {

// NewMsgServerImpl returns an implementation of the MsgServer interface
// for the provided Keeper.
func NewMsgServerImpl(keeper Keeper) types.MsgServiceServer {
func NewMsgServerImpl(keeper Keeper) types.MsgServer {
return &msgServer{Keeper: keeper}
}

var _ types.MsgServiceServer = msgServer{}
var _ types.MsgServer = msgServer{}
4 changes: 2 additions & 2 deletions x/aol/keeper/msg_server_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/medibloc/panacea-core/v2/x/aol/types"
)

func (k msgServer) AddRecord(goCtx context.Context, msg *types.MsgServiceAddRecordRequest) (*types.MsgServiceAddRecordResponse, error) {
func (k msgServer) AddRecord(goCtx context.Context, msg *types.MsgAddRecordRequest) (*types.MsgAddRecordResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress)
Expand Down Expand Up @@ -43,7 +43,7 @@ func (k msgServer) AddRecord(goCtx context.Context, msg *types.MsgServiceAddReco
}
k.SetRecord(ctx, recordKey, record)

return &types.MsgServiceAddRecordResponse{
return &types.MsgAddRecordResponse{
OwnerAddress: msg.OwnerAddress,
TopicName: msg.TopicName,
Offset: offset,
Expand Down
12 changes: 6 additions & 6 deletions x/aol/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {
ownerAddress := suite.GetAccAddress()

// create topic
msgCreateTopic := aoltypes.MsgServiceCreateTopicRequest{
msgCreateTopic := aoltypes.MsgCreateTopicRequest{
TopicName: topicName,
Description: "topic description",
OwnerAddress: ownerAddress.String(),
Expand All @@ -54,7 +54,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {
// add writer
moniker := "testMoniker"
writerAddress := suite.GetAccAddress()
msgAddWriter := aoltypes.MsgServiceAddWriterRequest{
msgAddWriter := aoltypes.MsgAddWriterRequest{
TopicName: topicName,
Moniker: moniker,
Description: "write Description",
Expand All @@ -68,7 +68,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {

// add writer2
writerAddress2 := suite.GetAccAddress()
msgAddWriter = aoltypes.MsgServiceAddWriterRequest{
msgAddWriter = aoltypes.MsgAddWriterRequest{
TopicName: topicName,
Moniker: moniker,
Description: "write Description2",
Expand Down Expand Up @@ -103,7 +103,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {
suite.Require().Equal(msgAddWriter.Moniker, getWriterResponse.Writer.Moniker)

// add record
msgAddRecord := aoltypes.MsgServiceAddRecordRequest{
msgAddRecord := aoltypes.MsgAddRecordRequest{
TopicName: topicName,
Key: []byte("key1"),
Value: []byte("value1"),
Expand All @@ -128,7 +128,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {
suite.Require().Equal(msgAddRecord.WriterAddress, getRecordResponse.Record.WriterAddress)

// add record2
msgAddRecord2 := aoltypes.MsgServiceAddRecordRequest{
msgAddRecord2 := aoltypes.MsgAddRecordRequest{
TopicName: topicName,
Key: []byte("key2"),
Value: []byte("value2"),
Expand Down Expand Up @@ -164,7 +164,7 @@ func (suite *aolMsgServerTestSuite) TestMsgServer() {
suite.Require().Equal(uint64(2), getTopicResponse.Topic.TotalWriters)

// delete writer
msgDeleteWriter := aoltypes.MsgServiceDeleteWriterRequest{
msgDeleteWriter := aoltypes.MsgDeleteWriterRequest{
TopicName: topicName,
WriterAddress: writerAddress2.String(),
OwnerAddress: ownerAddress.String(),
Expand Down
4 changes: 2 additions & 2 deletions x/aol/keeper/msg_server_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/medibloc/panacea-core/v2/x/aol/types"
)

func (k msgServer) CreateTopic(goCtx context.Context, msg *types.MsgServiceCreateTopicRequest) (*types.MsgServiceCreateTopicResponse, error) {
func (k msgServer) CreateTopic(goCtx context.Context, msg *types.MsgCreateTopicRequest) (*types.MsgCreateTopicResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress)
Expand All @@ -30,5 +30,5 @@ func (k msgServer) CreateTopic(goCtx context.Context, msg *types.MsgServiceCreat
topic := types.Topic{Description: msg.Description}
k.SetTopic(ctx, topicKey, topic)

return &types.MsgServiceCreateTopicResponse{}, nil
return &types.MsgCreateTopicResponse{}, nil
}
8 changes: 4 additions & 4 deletions x/aol/keeper/msg_server_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/medibloc/panacea-core/v2/x/aol/types"
)

func (k msgServer) AddWriter(goCtx context.Context, msg *types.MsgServiceAddWriterRequest) (*types.MsgServiceAddWriterResponse, error) {
func (k msgServer) AddWriter(goCtx context.Context, msg *types.MsgAddWriterRequest) (*types.MsgAddWriterResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress)
Expand Down Expand Up @@ -40,10 +40,10 @@ func (k msgServer) AddWriter(goCtx context.Context, msg *types.MsgServiceAddWrit
}
k.SetWriter(ctx, writerKey, writer)

return &types.MsgServiceAddWriterResponse{}, nil
return &types.MsgAddWriterResponse{}, nil
}

func (k msgServer) DeleteWriter(goCtx context.Context, msg *types.MsgServiceDeleteWriterRequest) (*types.MsgServiceDeleteWriterResponse, error) {
func (k msgServer) DeleteWriter(goCtx context.Context, msg *types.MsgDeleteWriterRequest) (*types.MsgDeleteWriterResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

ownerAddr, err := sdk.AccAddressFromBech32(msg.OwnerAddress)
Expand All @@ -66,5 +66,5 @@ func (k msgServer) DeleteWriter(goCtx context.Context, msg *types.MsgServiceDele

k.RemoveWriter(ctx, writerKey)

return &types.MsgServiceDeleteWriterResponse{}, nil
return &types.MsgDeleteWriterResponse{}, nil
}
Loading

0 comments on commit 099f253

Please sign in to comment.