Skip to content

Commit

Permalink
Renamed x/profiles messages response Proto definitions to match others
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Montagnin <[email protected]>
  • Loading branch information
RiccardoM committed Jul 12, 2021
1 parent 1a91657 commit 25b6c14
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 301 deletions.
13 changes: 7 additions & 6 deletions proto/desmos/profiles/v1beta1/msg_server.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,27 @@ service Msg {

// CreateRelationship defines a method for creating a new relationship
rpc CreateRelationship(MsgCreateRelationship)
returns (CreateRelationshipResponse);
returns (MsgCreateRelationshipResponse);

// DeleteRelationship defines a method for deleting a relationship
rpc DeleteRelationship(MsgDeleteRelationship)
returns (DeleteRelationshipResponse);
returns (MsgDeleteRelationshipResponse);

// BlockUser defines a method for blocking a user
rpc BlockUser(MsgBlockUser) returns (BlockUserResponse);
rpc BlockUser(MsgBlockUser) returns (MsgBlockUserResponse);

// UnblockUser defines a method for unblocking a user
rpc UnblockUser(MsgUnblockUser) returns (UnblockUserResponse);
rpc UnblockUser(MsgUnblockUser) returns (MsgUnblockUserResponse);

// LinkChainAccount defines a method to link an external chain account to a
// profile
rpc LinkChainAccount(MsgLinkChainAccount) returns (LinkChainAccountResponse);
rpc LinkChainAccount(MsgLinkChainAccount)
returns (MsgLinkChainAccountResponse);

// UnlinkChainAccount defines a method to unlink an external chain account
// from a profile
rpc UnlinkChainAccount(MsgUnlinkChainAccount)
returns (UnlinkChainAccountResponse);
returns (MsgUnlinkChainAccountResponse);

// LinkApplication defines a method to create a centralized application
// link
Expand Down
8 changes: 4 additions & 4 deletions proto/desmos/profiles/v1beta1/msgs_chain_links.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ message MsgLinkChainAccount {
string signer = 4 [ (gogoproto.moretags) = "yaml:\"signer\"" ];
}

// LinkChainAccountResponse defines the Msg/LinkAccount response type.
message LinkChainAccountResponse {}
// MsgLinkChainAccountResponse defines the Msg/LinkAccount response type.
message MsgLinkChainAccountResponse {}

// ___________________________________________________________________________________________________________________

Expand All @@ -53,5 +53,5 @@ message MsgUnlinkChainAccount {
string target = 3 [ (gogoproto.moretags) = "yaml:\"target\"" ];
}

// UnlinkChainAccountResponse defines the Msg/UnlinkAccount response type.
message UnlinkChainAccountResponse {}
// MsgUnlinkChainAccountResponse defines the Msg/UnlinkAccount response type.
message MsgUnlinkChainAccountResponse {}
18 changes: 10 additions & 8 deletions proto/desmos/profiles/v1beta1/msgs_relationships.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ message MsgCreateRelationship {
string subspace = 3 [ (gogoproto.moretags) = "yaml:\"subspace\"" ];
}

// CreateRelationshipResponse defines the Msg/CreateRelationship response type.
message CreateRelationshipResponse {}
// MsgCreateRelationshipResponse defines the Msg/CreateRelationship response
// type.
message MsgCreateRelationshipResponse {}

// ___________________________________________________________________________________________________________________

Expand All @@ -34,8 +35,9 @@ message MsgDeleteRelationship {
string subspace = 3 [ (gogoproto.moretags) = "yaml:\"subspace\"" ];
}

// DeleteRelationshipResponse defines the Msg/DeleteRelationship response type.
message DeleteRelationshipResponse {}
// MsgDeleteRelationshipResponse defines the Msg/DeleteRelationship response
// type.
message MsgDeleteRelationshipResponse {}

// ___________________________________________________________________________________________________________________

Expand All @@ -48,8 +50,8 @@ message MsgBlockUser {
string subspace = 4 [ (gogoproto.moretags) = "yaml:\"subspace\"" ];
}

// BlockUserResponse defines the Msg/BlockUser response type.
message BlockUserResponse {}
// MsgBlockUserResponse defines the Msg/BlockUser response type.
message MsgBlockUserResponse {}

// ___________________________________________________________________________________________________________________

Expand All @@ -60,5 +62,5 @@ message MsgUnblockUser {
string subspace = 4 [ (gogoproto.moretags) = "yaml:\"subspace\"" ];
}

// UnblockUserResponse defines the Msg/UnblockUser response type.
message UnblockUserResponse {}
// MsgUnblockUserResponse defines the Msg/UnblockUser response type.
message MsgUnblockUserResponse {}
8 changes: 4 additions & 4 deletions x/profiles/keeper/msg_server_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/desmos-labs/desmos/x/profiles/types"
)

func (k msgServer) BlockUser(goCtx context.Context, msg *types.MsgBlockUser) (*types.BlockUserResponse, error) {
func (k msgServer) BlockUser(goCtx context.Context, msg *types.MsgBlockUser) (*types.MsgBlockUserResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

userBlock := types.NewUserBlock(msg.Blocker, msg.Blocked, msg.Reason, msg.Subspace)
Expand All @@ -25,10 +25,10 @@ func (k msgServer) BlockUser(goCtx context.Context, msg *types.MsgBlockUser) (*t
sdk.NewAttribute(types.AttributeKeyUserBlockReason, msg.Reason),
))

return &types.BlockUserResponse{}, nil
return &types.MsgBlockUserResponse{}, nil
}

func (k msgServer) UnblockUser(goCtx context.Context, msg *types.MsgUnblockUser) (*types.UnblockUserResponse, error) {
func (k msgServer) UnblockUser(goCtx context.Context, msg *types.MsgUnblockUser) (*types.MsgUnblockUserResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

err := k.DeleteUserBlock(ctx, msg.Blocker, msg.Blocked, msg.Subspace)
Expand All @@ -43,5 +43,5 @@ func (k msgServer) UnblockUser(goCtx context.Context, msg *types.MsgUnblockUser)
sdk.NewAttribute(types.AttributeKeySubspace, msg.Subspace),
))

return &types.UnblockUserResponse{}, nil
return &types.MsgUnblockUserResponse{}, nil
}
10 changes: 5 additions & 5 deletions x/profiles/keeper/msg_server_chain_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/desmos-labs/desmos/x/profiles/types"
)

func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkChainAccount) (*types.LinkChainAccountResponse, error) {
func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkChainAccount) (*types.MsgLinkChainAccountResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

srcAddrData, err := types.UnpackAddressData(k.cdc, msg.ChainAddress)
Expand All @@ -31,14 +31,14 @@ func (k msgServer) LinkChainAccount(goCtx context.Context, msg *types.MsgLinkCha
sdk.NewAttribute(types.AttributeChainLinkCreationTime, link.CreationTime.Format(time.RFC3339Nano)),
))

return &types.LinkChainAccountResponse{}, nil
return &types.MsgLinkChainAccountResponse{}, nil
}

func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlinkChainAccount) (*types.UnlinkChainAccountResponse, error) {
func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlinkChainAccount) (*types.MsgUnlinkChainAccountResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

if err := k.DeleteChainLink(ctx, msg.Owner, msg.ChainName, msg.Target); err != nil {
return &types.UnlinkChainAccountResponse{}, err
return &types.MsgUnlinkChainAccountResponse{}, err
}

ctx.EventManager().EmitEvent(sdk.NewEvent(
Expand All @@ -48,5 +48,5 @@ func (k msgServer) UnlinkChainAccount(goCtx context.Context, msg *types.MsgUnlin
sdk.NewAttribute(types.AttributeChainLinkDestinationAddress, msg.Owner),
))

return &types.UnlinkChainAccountResponse{}, nil
return &types.MsgUnlinkChainAccountResponse{}, nil
}
8 changes: 4 additions & 4 deletions x/profiles/keeper/msg_server_relationships.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/desmos-labs/desmos/x/profiles/types"
)

func (k msgServer) CreateRelationship(goCtx context.Context, msg *types.MsgCreateRelationship) (*types.CreateRelationshipResponse, error) {
func (k msgServer) CreateRelationship(goCtx context.Context, msg *types.MsgCreateRelationship) (*types.MsgCreateRelationshipResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

// Check if the receiver has blocked the sender before
Expand All @@ -30,10 +30,10 @@ func (k msgServer) CreateRelationship(goCtx context.Context, msg *types.MsgCreat
sdk.NewAttribute(types.AttributeRelationshipSubspace, msg.Subspace),
))

return &types.CreateRelationshipResponse{}, nil
return &types.MsgCreateRelationshipResponse{}, nil
}

func (k msgServer) DeleteRelationship(goCtx context.Context, msg *types.MsgDeleteRelationship) (*types.DeleteRelationshipResponse, error) {
func (k msgServer) DeleteRelationship(goCtx context.Context, msg *types.MsgDeleteRelationship) (*types.MsgDeleteRelationshipResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)

err := k.RemoveRelationship(ctx, types.NewRelationship(msg.User, msg.Counterparty, msg.Subspace))
Expand All @@ -48,5 +48,5 @@ func (k msgServer) DeleteRelationship(goCtx context.Context, msg *types.MsgDelet
sdk.NewAttribute(types.AttributeRelationshipSubspace, msg.Subspace),
))

return &types.DeleteRelationshipResponse{}, nil
return &types.MsgDeleteRelationshipResponse{}, nil
}
Loading

0 comments on commit 25b6c14

Please sign in to comment.