Skip to content

Commit

Permalink
refactor packet keys
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaSripal committed Oct 25, 2024
1 parent 15877e8 commit f7c1491
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/core/24-host/v2/packet_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import (
// PacketReceiptKey returns the store key of under which a packet
// receipt is stored
func PacketReceiptKey(channelID string, sequence uint64) []byte {
return []byte(fmt.Sprintf("receipts/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence)))
return append(append([]byte(channelID), byte(3)), sdk.Uint64ToBigEndian(sequence)...)
}

// PacketAcknowledgementKey returns the store key of under which a packet acknowledgement is stored.
func PacketAcknowledgementKey(channelID string, sequence uint64) []byte {
return []byte(fmt.Sprintf("acks/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence)))
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 []byte(fmt.Sprintf("commitments/channels/%s/sequences/%s", channelID, sdk.Uint64ToBigEndian(sequence)))
return append(append([]byte(channelID), byte(1)), sdk.Uint64ToBigEndian(sequence)...)
}

// NextSequenceSendKey returns the store key for the next sequence send of a given channelID.
Expand Down

0 comments on commit f7c1491

Please sign in to comment.