mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
add function IsZero for type Address
This commit is contained in:
parent
8339e133ee
commit
4a59bdf15a
1 changed files with 3 additions and 0 deletions
|
|
@ -193,6 +193,9 @@ func IsHexAddress(s string) bool {
|
|||
return len(s) == 2*AddressLength && isHex(s)
|
||||
}
|
||||
|
||||
// IsZero returns if a address is empty
|
||||
func (a Address) IsZero() bool { return a == Address{} }
|
||||
|
||||
// Get the string representation of the underlying address
|
||||
func (a Address) Str() string { return string(a[:]) }
|
||||
func (a Address) Bytes() []byte { return a[:] }
|
||||
|
|
|
|||
Loading…
Reference in a new issue