Skip to content

Commit

Permalink
add typed event
Browse files Browse the repository at this point in the history
  • Loading branch information
nullpointer0x00 committed May 28, 2024
1 parent 415b36e commit 017652c
Show file tree
Hide file tree
Showing 3 changed files with 342 additions and 3 deletions.
12 changes: 12 additions & 0 deletions proto/provenance/ibchooks/v1/event.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";
package provenance.ibchooks.v1;

option go_package = "github.com/provenance-io/provenance/x/ibchooks/types";

option java_package = "io.provenance.ibchooks.v1";
option java_multiple_files = true;

// EventIBCHooksParamsUpdated defines the event emitted after updating ibchooks parameters.
message EventIBCHooksParamsUpdated {
repeated string allowed_async_ack_contracts = 1;
}
8 changes: 5 additions & 3 deletions x/ibchooks/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ func (k msgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdateParam
}

k.SetParams(ctx, msg.Params)
// if err := ctx.EventManager().EmitTypedEvent(); err != nil {
// return nil, err
// }
if err := ctx.EventManager().EmitTypedEvent(&types.EventIBCHooksParamsUpdated{
AllowedAsyncAckContracts: msg.Params.AllowedAsyncAckContracts,
}); err != nil {
return nil, err
}

return &types.MsgUpdateParamsResponse{}, nil
}
325 changes: 325 additions & 0 deletions x/ibchooks/types/event.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 017652c

Please sign in to comment.