Skip to content

Commit 067e75b

Browse files
authored
fix(gmp): fix keeper initialization and packet unmarshaling (#8660)
Fix two critical bugs in ICS27-GMP module: 1. keeper: Initialize msgRouter and accountKeeper fields that were being passed to NewKeeper but not assigned to the keeper struct, causing nil pointer panics when routing messages 2. packet: Fix UnmarshalPacketData to use correct Go unmarshal pattern by initializing pointer before passing to json.Unmarshal instead of passing pointer-to-pointer
1 parent c9a2f3c commit 067e75b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/apps/27-gmp/types/packet.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ func UnmarshalPacketData(bz []byte, ics27Version string, encoding string) (*GMPP
7777
panic("unsupported ics27 version")
7878
}
7979

80-
var data *GMPPacketData
80+
data := &GMPPacketData{}
8181
switch encoding {
8282
case EncodingJSON:
83-
if err := json.Unmarshal(bz, &data); err != nil {
83+
if err := json.Unmarshal(bz, data); err != nil {
8484
return nil, errorsmod.Wrapf(ibcerrors.ErrInvalidType, "failed to unmarshal json packet data: %s", err)
8585
}
8686
case EncodingProtobuf:

0 commit comments

Comments
 (0)