x/ibc: commit timeout timestamp (#6363)
Co-authored-by: Christopher Goes <cwgoes@pluranimity.org>
This commit is contained in:
parent
c26bbe6c9c
commit
c44813bcdf
|
@ -9,11 +9,11 @@ import (
|
||||||
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
|
host "github.com/cosmos/cosmos-sdk/x/ibc/24-host"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CommitPacket return the hash of commitment bytes
|
// CommitPacket returns a packet commitment bytes. The commitment consists of:
|
||||||
// TODO: no specification for packet commitment currently,
|
// hash(timeout_timestamp + timeout_height + data) from a given packet.
|
||||||
// make it spec compatible once we have it
|
|
||||||
func CommitPacket(packet exported.PacketI) []byte {
|
func CommitPacket(packet exported.PacketI) []byte {
|
||||||
buf := sdk.Uint64ToBigEndian(packet.GetTimeoutHeight())
|
buf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp())
|
||||||
|
buf = append(buf, sdk.Uint64ToBigEndian(packet.GetTimeoutHeight())...)
|
||||||
buf = append(buf, packet.GetData()...)
|
buf = append(buf, packet.GetData()...)
|
||||||
return tmhash.Sum(buf)
|
return tmhash.Sum(buf)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue