From 381401877bf5e191f3021926bcad46bf7ee38cb9 Mon Sep 17 00:00:00 2001 From: Aditya Sripal <14364734+AdityaSripal@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:27:34 +0100 Subject: [PATCH] provable keys --- modules/core/24-host/v2/packet_keys.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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.