diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-02 05:59:37 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-02 05:59:37 +0800 |
commit | d7e396a98ccafb53b4f632228b670634baeb36a0 (patch) | |
tree | 0cad411ce7bf1b8570fb6d2b8b5d9994b8e39ccd /ethutil/bytes.go | |
parent | 00d3935aac3f5d50bae56650c45e49a8b8705099 (diff) | |
download | go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar.gz go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar.bz2 go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar.lz go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar.xz go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.tar.zst go-tangerine-d7e396a98ccafb53b4f632228b670634baeb36a0.zip |
l <=> r
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r-- | ethutil/bytes.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go index 5737a75c9..ad60e62fd 100644 --- a/ethutil/bytes.go +++ b/ethutil/bytes.go @@ -119,7 +119,6 @@ func FormatData(data string) []byte { d := new(big.Int) if data[0:1] == "\"" && data[len(data)-1:] == "\"" { return RightPadBytes([]byte(data), 32) - //d.SetBytes([]byte(data[1 : len(data)-1])) } else if len(data) > 1 && data[:2] == "0x" { d.SetBytes(Hex2Bytes(data[2:])) } else { @@ -129,7 +128,7 @@ func FormatData(data string) []byte { return BigToBytes(d, 256) } -func LeftPadBytes(slice []byte, l int) []byte { +func RightPadBytes(slice []byte, l int) []byte { if l <= len(slice) { return slice } @@ -140,7 +139,7 @@ func LeftPadBytes(slice []byte, l int) []byte { return padded } -func RightPadBytes(slice []byte, l int) []byte { +func LeftPadBytes(slice []byte, l int) []byte { if l <= len(slice) { return slice } |