diff --git a/modules/core/24-host/v2/packet_keys.go b/modules/core/24-host/v2/packet_keys.go index 18e0213524f..72b707103ab 100644 --- a/modules/core/24-host/v2/packet_keys.go +++ b/modules/core/24-host/v2/packet_keys.go @@ -6,20 +6,20 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +// PacketCommitmentKey returns the store key of under which a packet commitment is stored. +func PacketCommitmentKey(channelID string, sequence uint64) []byte { + return append(append([]byte(channelID), byte(1)), sdk.Uint64ToBigEndian(sequence)...) +} + // PacketReceiptKey returns the store key of under which a packet // receipt is stored func PacketReceiptKey(channelID string, sequence uint64) []byte { - return append(append([]byte(channelID), byte(3)), sdk.Uint64ToBigEndian(sequence)...) + return append(append([]byte(channelID), byte(2)), sdk.Uint64ToBigEndian(sequence)...) } // PacketAcknowledgementKey returns the store key of under which a packet acknowledgement is stored. func PacketAcknowledgementKey(channelID string, sequence uint64) []byte { - return append(append([]byte(channelID), byte(2)), sdk.Uint64ToBigEndian(sequence)...) -} - -// PacketCommitmentKey returns the store key of under which a packet commitment is stored. -func PacketCommitmentKey(channelID string, sequence uint64) []byte { - return append(append([]byte(channelID), byte(1)), sdk.Uint64ToBigEndian(sequence)...) + return append(append([]byte(channelID), byte(3)), sdk.Uint64ToBigEndian(sequence)...) } // NextSequenceSendKey returns the store key for the next sequence send of a given channelID.