aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/packing.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2016-06-10 15:14:42 +0800
committerGitHub <noreply@github.com>2016-06-10 15:14:42 +0800
commitc039bb38d45d9d8efcd88e1342d35656651a8ac8 (patch)
tree4fac6d666221c972593eb7bef701dfeefe60ecc2 /accounts/abi/packing.go
parent6886913fdf7feaf39c49f1afebae1ef8ea10b514 (diff)
parent89c6c5bb85ff24c152218f245fa366e733c951a7 (diff)
downloaddexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar.gz
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar.bz2
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar.lz
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar.xz
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.tar.zst
dexon-c039bb38d45d9d8efcd88e1342d35656651a8ac8.zip
Merge pull request #2653 from tbocek/develop
Negative numbers not properly converted in ABI encoding
Diffstat (limited to 'accounts/abi/packing.go')
-rw-r--r--accounts/abi/packing.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/accounts/abi/packing.go b/accounts/abi/packing.go
index c765dfdf3..0c37edf17 100644
--- a/accounts/abi/packing.go
+++ b/accounts/abi/packing.go
@@ -25,7 +25,7 @@ import (
// packBytesSlice packs the given bytes as [L, V] as the canonical representation
// bytes slice
func packBytesSlice(bytes []byte, l int) []byte {
- len := packNum(reflect.ValueOf(l), UintTy)
+ len := packNum(reflect.ValueOf(l))
return append(len, common.RightPadBytes(bytes, (l+31)/32*32)...)
}
@@ -34,7 +34,7 @@ func packBytesSlice(bytes []byte, l int) []byte {
func packElement(t Type, reflectValue reflect.Value) []byte {
switch t.T {
case IntTy, UintTy:
- return packNum(reflectValue, t.T)
+ return packNum(reflectValue)
case StringTy:
return packBytesSlice([]byte(reflectValue.String()), reflectValue.Len())
case AddressTy: