aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/reflect.go
diff options
context:
space:
mode:
authorRJ Catalano <catalanor0220@gmail.com>2017-06-27 16:05:33 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-06-27 16:05:33 +0800
commit5421a08d2f924558056c8a382017ec37f56010e9 (patch)
treed9172c82a3720173d525b083e67c6698fd7b5502 /accounts/abi/reflect.go
parentcf611c50b9bd7a7c410a49699e0c4e718b4a7177 (diff)
downloaddexon-5421a08d2f924558056c8a382017ec37f56010e9.tar
dexon-5421a08d2f924558056c8a382017ec37f56010e9.tar.gz
dexon-5421a08d2f924558056c8a382017ec37f56010e9.tar.bz2
dexon-5421a08d2f924558056c8a382017ec37f56010e9.tar.lz
dexon-5421a08d2f924558056c8a382017ec37f56010e9.tar.xz
dexon-5421a08d2f924558056c8a382017ec37f56010e9.tar.zst
dexon-5421a08d2f924558056c8a382017ec37f56010e9.zip
accounts/abi: reorganizing package with small fixes (#14610)
* accounts/abi: reorganizing package and some notes and a quick correction of name. Signed-off-by: RJ Catalano <rj@monax.io> get rid of some imports Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: move file names Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix boolean decode function Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix for the array set and for creating a bool Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: be very very very correct Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix up error message and variable names Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: take out unnecessary argument in pack method Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: add bool unpack test and add a panic to readBool function Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix panic message Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: change from panic to basic error Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix nil to false Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fill out type regex tests and fill with the correct type for integers Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: move packNumbers into pack.go. Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: separation of the testing suite into appropriately named files. Signed-off-by: RJ Catalano <rj@monax.io> * account/abi: change to hex string tests. Signed-off-by: RJ Catalano <rj@monax.io> * account/abi: fix up rest of tests to hex Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: declare bool at the package level Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: use errors package in the error file. Signed-off-by: RJ Catalano <rj@monax.io> * accounts/abi: fix ugly hack and fix error type declaration. Signed-off-by: RJ Catalano <rj@monax.io>
Diffstat (limited to 'accounts/abi/reflect.go')
-rw-r--r--accounts/abi/reflect.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go
index 7970ba8ac..8fa75df07 100644
--- a/accounts/abi/reflect.go
+++ b/accounts/abi/reflect.go
@@ -32,30 +32,30 @@ func indirect(v reflect.Value) reflect.Value {
// reflectIntKind returns the reflect using the given size and
// unsignedness.
-func reflectIntKind(unsigned bool, size int) reflect.Kind {
+func reflectIntKindAndType(unsigned bool, size int) (reflect.Kind, reflect.Type) {
switch size {
case 8:
if unsigned {
- return reflect.Uint8
+ return reflect.Uint8, uint8_t
}
- return reflect.Int8
+ return reflect.Int8, int8_t
case 16:
if unsigned {
- return reflect.Uint16
+ return reflect.Uint16, uint16_t
}
- return reflect.Int16
+ return reflect.Int16, int16_t
case 32:
if unsigned {
- return reflect.Uint32
+ return reflect.Uint32, uint32_t
}
- return reflect.Int32
+ return reflect.Int32, int32_t
case 64:
if unsigned {
- return reflect.Uint64
+ return reflect.Uint64, uint64_t
}
- return reflect.Int64
+ return reflect.Int64, int64_t
}
- return reflect.Ptr
+ return reflect.Ptr, big_t
}
// mustArrayToBytesSlice creates a new byte slice with the exact same size as value