forked from cerc-io/laconicd-deprecated
stargate: migrate types (#670)
* 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
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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())
|
||||
}
|
||||
Reference in New Issue
Block a user