Skip to content

Commit

Permalink
fix eip712 salt
Browse files Browse the repository at this point in the history
Signed-off-by: Jun Kimura <[email protected]>
  • Loading branch information
bluele committed Jun 18, 2024
1 parent 22451ea commit c1c2307
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions light-clients/lcp/types/lcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ func (t ChainType) Uint16() uint16 {
}

func ComputeChainSalt(chainID string, prefix []byte) common.Hash {
// salt = Hash(| ChainType | Hash(ChainID) | Hash(Prefix) |)
msg := make([]byte, 2)
binary.BigEndian.PutUint16(msg, ChainTypeCosmos.Uint16())
// TODO abi encode?
msg = append(msg, []byte(chainID)...)
msg = append(msg, prefix...)
msg = append(msg, crypto.Keccak256Hash([]byte(chainID)).Bytes()...)
msg = append(msg, crypto.Keccak256Hash(prefix).Bytes()...)
return crypto.Keccak256Hash(msg)
}

Expand Down

0 comments on commit c1c2307

Please sign in to comment.