Handle '0x' or 'xdc' prefix

This commit is contained in:
Anil Chinchawale 2021-09-23 17:54:08 +05:30 committed by GitHub
parent f4e745b72e
commit e1daa99b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -242,7 +242,9 @@ func (a *Address) Set(other Address) {
// MarshalText returns the hex representation of a.
func (a Address) MarshalText() ([]byte, error) {
return hexutil.Bytes(a[:]).MarshalText()
// Handle '0x' or 'xdc' prefix here.
// return hexutil.Bytes(a[:]).MarshalText()
return hexutil.Bytes(a[:]).MarshalXDCText()
}
// UnmarshalText parses a hash in hex syntax.