Skip to content

Commit

Permalink
fix: panic when 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 5adbfe6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x/stake/handler_sidechain.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,7 @@ func handleMsgSideChainUndelegate(ctx sdk.Context, msg MsgSideChainUndelegate, k

// publish undelegate event
if k.PbsbServer != nil && ctx.IsDeliverTx() {
txHash, _ := ctx.Value(baseapp.TxHashKey).(string)
event := types.ChainUndelegateEvent{
UndelegateEvent: types.UndelegateEvent{
StakeEvent: types.StakeEvent{
Expand All @@ -470,7 +471,7 @@ func handleMsgSideChainUndelegate(ctx sdk.Context, msg MsgSideChainUndelegate, k
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 5adbfe6

Please sign in to comment.