From e1daa99b52376026168879d7715c68a5f5737547 Mon Sep 17 00:00:00 2001 From: Anil Chinchawale Date: Thu, 23 Sep 2021 17:54:08 +0530 Subject: [PATCH] Handle '0x' or 'xdc' prefix --- common/types.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/types.go b/common/types.go index dc1e1d6713..7e0b5f2587 100644 --- a/common/types.go +++ b/common/types.go @@ -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.