Skip to content

Commit

Permalink
fix: publish ChainUndelegateEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Mar 1, 2024
1 parent eeced6c commit 57c2ca3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions x/stake/handler_sidechain.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,17 +460,19 @@ func handleMsgSideChainUndelegate(ctx sdk.Context, msg MsgSideChainUndelegate, k
)

// publish undelegate event
ctx.Logger().Info("publish undelegate event", "ctx.IsDeliverTx()", ctx.IsDeliverTx(), "PbsbServer", k.PbsbServer != nil, "PbsbServer_IsRunning", k.PbsbServer.IsRunning())
if k.PbsbServer != nil && ctx.IsDeliverTx() {
txHash, isFromTx := ctx.Value(baseapp.TxHashKey).(string)
event := types.ChainUndelegateEvent{
UndelegateEvent: types.UndelegateEvent{
StakeEvent: types.StakeEvent{
IsFromTx: true,
IsFromTx: isFromTx,
},
Delegator: msg.DelegatorAddr,
Validator: msg.ValidatorAddr,
Amount: msg.Amount.Amount,
Denom: msg.Amount.Denom,
TxHash: ctx.Value(baseapp.TxHashKey).(string),
TxHash: txHash,
},
ChainId: msg.SideChainId,
}
Expand Down

0 comments on commit 57c2ca3

Please sign in to comment.