add function IsZero for type Address

This commit is contained in:
Daniel Liu 2023-07-14 11:23:08 +08:00
parent 8339e133ee
commit 4a59bdf15a

View file

@ -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[:] }