Skip to content

Commit 0b45a17

Browse files
fix: remove packet data remarshaling (#8060) (#8064)
(cherry picked from commit 826ab59) Co-authored-by: Gjermund Garaba <[email protected]>
1 parent 3d667ca commit 0b45a17

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

modules/apps/transfer/types/packet.go

-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package types
22

33
import (
4-
"bytes"
54
"encoding/json"
65
"errors"
76
"strings"
@@ -264,13 +263,6 @@ func UnmarshalPacketData(bz []byte, ics20Version string, encoding string) (Inter
264263
// We should never get here, as we manually constructed the type at the beginning of the file
265264
return InternalTransferRepresentation{}, errorsmod.Wrapf(ibcerrors.ErrInvalidType, "cannot convert proto message into FungibleTokenPacketData")
266265
}
267-
bz2, err := MarshalPacketData(*datav1, ics20Version, encoding)
268-
if err != nil {
269-
return InternalTransferRepresentation{}, errorsmod.Wrapf(ibcerrors.ErrInvalidType, "cannot marshal transfer packet data: %s", err.Error())
270-
}
271-
if !bytes.Equal(bz, bz2) {
272-
return InternalTransferRepresentation{}, errorsmod.Wrapf(ibcerrors.ErrInvalidType, "marshaled bytes are not equal: got %X, expected %X", bz2, bz)
273-
}
274266
// The call to ValidateBasic for V1 is done inside PacketDataV1toV2.
275267
return PacketDataV1ToV2(*datav1)
276268
}

0 commit comments

Comments
 (0)