Skip to content

Commit

Permalink
fix: remove packet data remarshaling (#8060)
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba authored Feb 27, 2025
1 parent 564bb6e commit 826ab59
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions modules/apps/transfer/types/packet.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package types

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

0 comments on commit 826ab59

Please sign in to comment.