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

chore(x/fbridge): add the event of SetBridgeStatus (backport #1369) #1370

Merged
merged 1 commit into from
May 8, 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
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.

Loading