Skip to content

Commit

Permalink
more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
luckychess committed Nov 19, 2024
1 parent 73a4fd7 commit 6ea4835
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions x/gmp/module_ibc.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,12 @@ func (im IBCModule) OnRecvPacket(
return channeltypes.NewErrorAcknowledgement(cosmossdkerrors.Wrapf(transfertypes.ErrInvalidMemo, "unable to unpack payload (%s)", err.Error()))
}
pfmPayload := args[0].(string)
ctx.Logger().Info(fmt.Sprintf("Got pfmPayload: %v", pfmPayload))
var pfmJSON PFMPayload
if err = json.Unmarshal([]byte(pfmPayload), &pfmJSON); err != nil {
return channeltypes.NewErrorAcknowledgement(cosmossdkerrors.Wrapf(transfertypes.ErrInvalidMemo, "cannot unmarshal pfm payload: %s", err.Error()))
}
ctx.Logger().Info(fmt.Sprintf("Parsed pfmPayload: %+v", pfmJSON))
// Now update modulePacket with new memo
// Convert payload to the new structure
forwardPayload := convertToForwardPayload(&pfmJSON)
Expand All @@ -241,24 +243,6 @@ func (im IBCModule) OnRecvPacket(
default:
return channeltypes.NewErrorAcknowledgement(cosmossdkerrors.Wrapf(transfertypes.ErrInvalidMemo, "unrecognized message type (%d)", msg.Type))
}

// if err != nil {
// return channeltypes.NewErrorAcknowledgement(cosmossdkerrors.Wrapf(err, "unable to handle GMP message"))
// }

// ctx.Logger().Info(fmt.Sprintf("OnRecvPacket: %v", modulePacket))

// ack := im.app.OnRecvPacket(ctx, modulePacket, relayer)
// if !ack.Success() {
// return ack
// }

// ctx.Logger().Info(fmt.Sprintf("Ack after app.OnRecvPacket: %v", ack))

// if err != nil {
// return channeltypes.NewErrorAcknowledgement(err)
// }
// return ack
}

// OnAcknowledgementPacket implements the IBCModule interface
Expand Down

0 comments on commit 6ea4835

Please sign in to comment.