Skip to content

Commit

Permalink
emit events
Browse files Browse the repository at this point in the history
  • Loading branch information
beer-1 committed Apr 9, 2024
1 parent 78add35 commit bcfdfa3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions x/opchild/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,15 @@ func (ms MsgServer) SetBridgeInfo(ctx context.Context, req *types.MsgSetBridgeIn
return nil, err
}

Check warning on line 302 in x/opchild/keeper/msg_server.go

View check run for this annotation

Codecov / codecov/patch

x/opchild/keeper/msg_server.go#L301-L302

Added lines #L301 - L302 were not covered by tests

sdkCtx := sdk.UnwrapSDKContext(ctx)
sdkCtx.EventManager().EmitEvent(
sdk.NewEvent(
types.EventTypeSetBridgeInfo,
sdk.NewAttribute(types.AttributeKeyBridgeId, strconv.FormatUint(req.BridgeInfo.BridgeId, 10)),
sdk.NewAttribute(types.AttributeKeyBridgeAddr, req.BridgeInfo.BridgeAddr),
),
)

return &types.MsgSetBridgeInfoResponse{}, nil
}

Expand Down
3 changes: 3 additions & 0 deletions x/opchild/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ const (
EventTypeExecuteMessages = "execute_messages"
EventTypeWhitelist = "whitelist"
EventTypeParams = "params"
EventTypeSetBridgeInfo = "set_bridge_info"

AttributeKeySender = "sender"
AttributeKeyBridgeId = "bridge_id"
AttributeKeyBridgeAddr = "bridge_addr"
AttributeKeyRecipient = "recipient"
AttributeKeyAmount = "amount"
AttributeKeyDenom = "denom"
Expand Down

0 comments on commit bcfdfa3

Please sign in to comment.