9cbb4dcf6d
* changelog v0.4.0 * stargate: types changes * msg and handler changes * validation * fixes * more fixes * more test fixes * changelog * changelog * lint * rm comment * lint * redundant if condition
18 lines
503 B
Go
18 lines
503 B
Go
package types
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
ethcmn "github.com/ethereum/go-ethereum/common"
|
|
)
|
|
|
|
// IsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash.
|
|
func IsEmptyHash(hash string) bool {
|
|
return bytes.Equal(ethcmn.HexToHash(hash).Bytes(), ethcmn.Hash{}.Bytes())
|
|
}
|
|
|
|
// IsZeroAddress returns true if the address corresponds to an empty ethereum hex address.
|
|
func IsZeroAddress(address string) bool {
|
|
return bytes.Equal(ethcmn.HexToAddress(address).Bytes(), ethcmn.Address{}.Bytes())
|
|
}
|