Skip to content

Commit

Permalink
add the event of SetBridgeStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 committed May 8, 2024
1 parent a9be0cb commit d480046
Show file tree
Hide file tree
Showing 4 changed files with 270 additions and 29 deletions.
17 changes: 17 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@
- [EventClaim](#lbm.fbridge.v1.EventClaim)
- [EventConfirmProvision](#lbm.fbridge.v1.EventConfirmProvision)
- [EventProvision](#lbm.fbridge.v1.EventProvision)
- [EventSetBridgeStatus](#lbm.fbridge.v1.EventSetBridgeStatus)
- [EventSuggestRole](#lbm.fbridge.v1.EventSuggestRole)
- [EventTransfer](#lbm.fbridge.v1.EventTransfer)
- [EventUpdateParams](#lbm.fbridge.v1.EventUpdateParams)
Expand Down Expand Up @@ -11691,6 +11692,22 @@ VoteOption enumerates the valid vote options for a given role proposal.



<a name="lbm.fbridge.v1.EventSetBridgeStatus"></a>

### EventSetBridgeStatus



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `guardian` | [string](#string) | | the guardian address who modifies the bridge status (a.k.a. bridge switch) |
| `status` | [BridgeStatus](#lbm.fbridge.v1.BridgeStatus) | | the new status of the guardian's bridge switch |






<a name="lbm.fbridge.v1.EventSuggestRole"></a>

### EventSuggestRole
Expand Down
7 changes: 7 additions & 0 deletions proto/lbm/fbridge/v1/event.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,10 @@ message EventClaim {
// the amount of token to be claimed
string amount = 4;
}

message EventSetBridgeStatus {
// the guardian address who modifies the bridge status (a.k.a. bridge switch)
string guardian = 1;
// the new status of the guardian's bridge switch
BridgeStatus status = 2;
}
7 changes: 7 additions & 0 deletions x/fbridge/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,5 +164,12 @@ func (m msgServer) SetBridgeStatus(goCtx context.Context, msg *types.MsgSetBridg
return nil, err
}

if err := ctx.EventManager().EmitTypedEvent(&types.EventSetBridgeStatus{
Guardian: msg.Guardian,
Status: msg.Status,
}); err != nil {
panic(err)
}

return &types.MsgSetBridgeStatusResponse{}, nil
}
268 changes: 239 additions & 29 deletions x/fbridge/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 d480046

Please sign in to comment.