forked from cerc-io/plugeth
l <=> r
This commit is contained in:
parent
00d3935aac
commit
d7e396a98c
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user