Skip to content

Commit

Permalink
chore(x/fbridge): add the event of SetBridgeStatus (#1369)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkxkd0159 authored May 8, 2024
1 parent a9be0cb commit 5e40d34
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 @@ -60,6 +60,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
* chore(deps) [\#1141](https://github.com/Finschia/finschia-sdk/pull/1141) Bump github.com/cosmos/ledger-cosmos-go from 0.12.2 to 0.13.2 to fix ledger signing issue
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 @@ -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 5e40d34

Please sign in to comment.