diff --git a/common/bytes.go b/common/bytes.go index 4998d1701..f9d82cd21 100644 --- a/common/bytes.go +++ b/common/bytes.go @@ -18,31 +18,9 @@ package common import ( - "bytes" "encoding/hex" ) -// ToHex returns the hex representation of b, prefixed with '0x'. -// For empty slices, the return value is "0x0". -// -// Deprecated: use hexutil.Encode instead. -func ToHex(b []byte) string { - hex := Bytes2Hex(b) - if len(hex) == 0 { - hex = "0" - } - return "0x" + hex -} - -// ToHexArray creates a array of hex-string based on []byte -func ToHexArray(b [][]byte) []string { - r := make([]string, len(b)) - for i := range b { - r[i] = ToHex(b[i]) - } - return r -} - // FromHex returns the bytes represented by the hexadecimal string s. // s may be prefixed with "0x". func FromHex(s string) []byte { diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index cc17d3dd3..117a4f5de 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1890,3 +1890,12 @@ func checkTxFee(gasPrice *big.Int, gas uint64, cap float64) error { } return nil } + +// toHexSlice creates a slice of hex-strings based on []byte. +func toHexSlice(b [][]byte) []string { + r := make([]string, len(b)) + for i := range b { + r[i] = hexutil.Encode(b[i]) + } + return r +}