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/QB-2411: Events optimization #341

Merged
merged 1 commit into from
Feb 21, 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
648 changes: 13 additions & 635 deletions api/stratos/pot/v1/event.pulsar.go

Large diffs are not rendered by default.

653 changes: 16 additions & 637 deletions api/stratos/register/v1/event.pulsar.go

Large diffs are not rendered by default.

648 changes: 13 additions & 635 deletions api/stratos/sds/v1/event.pulsar.go

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions proto/stratos/pot/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,3 @@ message EventSlashing {
string slashing_type = 4;
string suspend = 5;
}

// EventMessage
message EventMessage {
// module which emits the event
string module = 1;
// sender of the message
string sender = 2;
// tx_type is the type of the message
string action = 3;
}
10 changes: 0 additions & 10 deletions proto/stratos/register/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,3 @@ message EventCompleteUnBondingMetaNode{
string amount = 1;
string network_address = 2;
}

// EventMessage
message EventMessage {
// module which emits the event
string module = 1;
// sender of the message
string sender = 2;
// tx_type is the type of the message
string action = 3;
}
11 changes: 0 additions & 11 deletions proto/stratos/sds/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,3 @@ message EventFileUpload {
string uploader = 3;
string file_hash = 4;
}

// EventMessage
message EventMessage {
// module which emits the event
string module = 1;
// sender of the message
string sender = 2;
// tx_type is the type of the message
string action = 3;
}

25 changes: 0 additions & 25 deletions x/pot/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ func (k msgServer) HandleMsgVolumeReport(goCtx context.Context, msg *types.MsgVo
ReportReference: msg.GetReportReference(),
Epoch: msg.Epoch.String(),
},
&types.EventMessage{
Module: types.ModuleName,
Sender: msg.GetReporterOwner(),
},
)
if err != nil {
return nil, errors.Wrap(types.ErrEmitEvent, err.Error())
Expand Down Expand Up @@ -128,10 +124,6 @@ func (k msgServer) HandleMsgWithdraw(goCtx context.Context, msg *types.MsgWithdr
WalletAddress: msg.GetWalletAddress(),
TargetAddress: msg.GetTargetAddress(),
},
&types.EventMessage{
Module: types.ModuleName,
Sender: msg.GetWalletAddress(),
},
)
if err != nil {
return nil, errors.Wrap(types.ErrEmitEvent, err.Error())
Expand All @@ -155,10 +147,6 @@ func (k msgServer) HandleMsgFoundationDeposit(goCtx context.Context, msg *types.
&types.EventFoundationDeposit{
Amount: msg.GetAmount().String(),
},
&types.EventMessage{
Module: types.ModuleName,
Sender: msg.GetFrom(),
},
)
if err != nil {
return nil, errors.Wrap(types.ErrEmitEvent, err.Error())
Expand Down Expand Up @@ -214,10 +202,6 @@ func (k msgServer) HandleMsgSlashingResourceNode(goCtx context.Context, msg *typ
SlashingType: nodeType.String(),
Suspend: strconv.FormatBool(msg.GetSuspend()),
},
&types.EventMessage{
Module: types.ModuleName,
Sender: msg.GetWalletAddress(),
},
)
if err != nil {
return nil, errors.Wrap(types.ErrEmitEvent, err.Error())
Expand All @@ -238,14 +222,5 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam
return nil, err
}

err = ctx.EventManager().EmitTypedEvent(&types.EventMessage{
Module: types.ModuleName,
Sender: msg.Authority,
Action: sdk.MsgTypeURL(msg),
})
if err != nil {
return nil, errors.Wrap(types.ErrEmitEvent, err.Error())
}

return &types.MsgUpdateParamsResponse{}, nil
}
Loading