Skip to content

Commit

Permalink
Removed unnecessary keys from provider module events
Browse files Browse the repository at this point in the history
  • Loading branch information
bsrinivas8687 committed Aug 15, 2021
1 parent b0257d4 commit a40c2ec
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 538 deletions.
25 changes: 8 additions & 17 deletions proto/sentinel/provider/v1/events.proto
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
syntax = "proto3";
package sentinel.provider.v1;

option go_package = "github.com/sentinel-official/hub/x/provider/types";

import "gogoproto/gogo.proto";

option go_package = "github.com/sentinel-official/hub/x/provider/types";
option (gogoproto.equal_all) = false;
option (gogoproto.goproto_getters_all) = false;

message EventModule { string name = 1; }
message EventModule {
string name = 1 [ (gogoproto.moretags) = "yaml:\"name\"" ];
}

message EventRegisterProvider {
string from = 1;
string address = 2;
string name = 3;
string identity = 4;
string website = 5;
string description = 6;
message EventRegister {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}

message EventUpdateProvider {
string from = 1;
string address = 2;
string name = 3;
string identity = 4;
string website = 5;
string description = 6;
message EventUpdate {
string address = 1 [ (gogoproto.moretags) = "yaml:\"address\"" ];
}
18 changes: 4 additions & 14 deletions x/provider/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,8 @@ func (k *msgServer) MsgRegister(c context.Context, msg *types.MsgRegisterRequest

k.SetProvider(ctx, provider)
ctx.EventManager().EmitTypedEvent(
&types.EventRegisterProvider{
From: sdk.AccAddress(msgFrom.Bytes()).String(),
Address: provider.Address,
Name: provider.Name,
Identity: provider.Identity,
Website: provider.Website,
Description: provider.Description,
&types.EventRegister{
Address: provider.Address,
},
)

Expand Down Expand Up @@ -96,13 +91,8 @@ func (k *msgServer) MsgUpdate(c context.Context, msg *types.MsgUpdateRequest) (*

k.SetProvider(ctx, provider)
ctx.EventManager().EmitTypedEvent(
&types.EventUpdateProvider{
From: sdk.AccAddress(msgFrom.Bytes()).String(),
Address: provider.Address,
Name: msg.Name,
Identity: msg.Identity,
Website: msg.Website,
Description: msg.Description,
&types.EventUpdate{
Address: provider.Address,
},
)

Expand Down
Loading

0 comments on commit a40c2ec

Please sign in to comment.