Fixed string data

pull/150/head
obscuren 10 years ago
parent 3331bb29ea
commit a626b7ebe1
  1. 2
      ethutil/bytes.go

@ -118,7 +118,7 @@ func FormatData(data string) []byte {
// Simple stupid
d := new(big.Int)
if data[0:1] == "\"" && data[len(data)-1:] == "\"" {
return RightPadBytes([]byte(data), 32)
return RightPadBytes([]byte(data[1:len(data)-1]), 32)
} else if len(data) > 1 && data[:2] == "0x" {
d.SetBytes(Hex2Bytes(data[2:]))
} else {

Loading…
Cancel
Save