Skip to content

Commit

Permalink
chore: default to json encoding in conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
bznein committed Sep 12, 2024
1 parent 554e484 commit be1e9bc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/core/04-channel/types/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ func ConvertPacketV1toV2(packet Packet) (PacketV2, error) {
if packet.ProtocolVersion != IBC_VERSION_2 {
return PacketV2{}, errorsmod.Wrapf(ErrInvalidPacket, "expected protocol version %s, got %s instead", IBC_VERSION_2, packet.ProtocolVersion)
}

encoding := packet.Encoding
if encoding == "" {
encoding = "json"
}

return PacketV2{
Sequence: packet.Sequence,
SourceId: packet.SourceChannel,
Expand All @@ -281,7 +287,7 @@ func ConvertPacketV1toV2(packet Packet) (PacketV2, error) {
DestinationPort: packet.DestinationPort,
Payload: Payload{
Version: packet.AppVersion,
Encoding: packet.Encoding,
Encoding: encoding,
Value: packet.Data,
},
},
Expand Down

0 comments on commit be1e9bc

Please sign in to comment.