diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-11-29 08:21:41 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-11-29 08:25:32 +0800 |
commit | b33a5294eaf06a3e952efe1ce4ef810af37d1062 (patch) | |
tree | efb7b8e936fe001180067703fcb226c90779023a /common/bytes.go | |
parent | be12392fbad9f4a861130a347e6bcf07a5c34974 (diff) | |
download | go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar.gz go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar.bz2 go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar.lz go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar.xz go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.tar.zst go-tangerine-b33a5294eaf06a3e952efe1ce4ef810af37d1062.zip |
common: fix hex utils to handle 1 byte address conversions
Diffstat (limited to 'common/bytes.go')
-rw-r--r-- | common/bytes.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/bytes.go b/common/bytes.go index 66577bbfd..bb40ac1d7 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -35,12 +35,11 @@ func FromHex(s string) []byte { if s[0:2] == "0x" || s[0:2] == "0X" { s = s[2:] } - if len(s)%2 == 1 { - s = "0" + s - } - return Hex2Bytes(s) } - return nil + if len(s)%2 == 1 { + s = "0" + s + } + return Hex2Bytes(s) } // Copy bytes |