Skip to content

Commit

Permalink
chore(x/fbridge): add the event of SetBridgeStatus (#1369) (#1370)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5e40d34)

Co-authored-by: Jaeseung Lee <[email protected]>
  • Loading branch information
mergify[bot] and tkxkd0159 authored May 8, 2024
1 parent abe3a24 commit defb3ad
Show file tree
Hide file tree
Showing 5 changed files with 271 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (types) [\#1314](https://github.com/Finschia/finschia-sdk/pull/1314) replace IsEqual with Equal
* (x/fswap) [\#1363](https://github.com/Finschia/finschia-sdk/pull/1363) introduce new event for MakeSwapProposal
* (x/fbridge) [\#1366](https://github.com/Finschia/finschia-sdk/pull/1366) Set target denom as module parameters
* (x/fbridge) [\#1369](https://github.com/Finschia/finschia-sdk/pull/1369) Add the event of `SetBridgeStatus`

### Bug Fixes
* (x/auth) [#1281](https://github.com/Finschia/finschia-sdk/pull/1281) `ModuleAccount.Validate` now reports a nil `.BaseAccount` instead of panicking. (backport #1274)
Expand Down
17 changes: 17 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,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 @@ -12052,6 +12053,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 defb3ad

Please sign in to comment.