Fixed string data
This commit is contained in:
parent
3331bb29ea
commit
a626b7ebe1
|
@ -118,7 +118,7 @@ func FormatData(data string) []byte {
|
||||||
// Simple stupid
|
// Simple stupid
|
||||||
d := new(big.Int)
|
d := new(big.Int)
|
||||||
if data[0:1] == "\"" && data[len(data)-1:] == "\"" {
|
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" {
|
} else if len(data) > 1 && data[:2] == "0x" {
|
||||||
d.SetBytes(Hex2Bytes(data[2:]))
|
d.SetBytes(Hex2Bytes(data[2:]))
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue