Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: remove packet data remarshaling #8060

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading