aboutsummaryrefslogtreecommitdiffstats
path: root/common/hexutil/hexutil.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/hexutil/hexutil.go')
-rw-r--r--common/hexutil/hexutil.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/common/hexutil/hexutil.go b/common/hexutil/hexutil.go
index 29e6de333..4ec0ee8e6 100644
--- a/common/hexutil/hexutil.go
+++ b/common/hexutil/hexutil.go
@@ -169,12 +169,7 @@ func EncodeBig(bigint *big.Int) string {
if nbits == 0 {
return "0x0"
}
- enc := make([]byte, 2, (nbits/8)*2+2)
- copy(enc, "0x")
- for i := len(bigint.Bits()) - 1; i >= 0; i-- {
- enc = strconv.AppendUint(enc, uint64(bigint.Bits()[i]), 16)
- }
- return string(enc)
+ return fmt.Sprintf("0x%x", bigint)
}
func has0xPrefix(input string) bool {