mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-04 20:21:15 +00:00
Merge pull request #2 from XinFinOrg/apothem
Handle '0x' or 'xdc' prefix
This commit is contained in:
commit
75b2f3ca9c
1 changed files with 3 additions and 1 deletions
|
|
@ -249,7 +249,9 @@ func (a *Address) Set(other Address) {
|
||||||
|
|
||||||
// MarshalText returns the hex representation of a.
|
// MarshalText returns the hex representation of a.
|
||||||
func (a Address) MarshalText() ([]byte, error) {
|
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.
|
// UnmarshalText parses a hash in hex syntax.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue