From 5127ec10cb84a615f4d5b314e4c3c102efefe4c9 Mon Sep 17 00:00:00 2001 From: Jeffrey Wilcke Date: Thu, 7 Apr 2016 11:39:22 +0200 Subject: accouns/abi: refactored ABI package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactored the abi package parsing and type handling. Relying mostly on package reflect as opposed to most of our own type reflection. Our own type reflection is still used however for cases such as Bytes and FixedBytes (abi: bytes•). This also inclused several fixes for slice handling of arbitrary and fixed size for all supported types. This also further removes implicit type casting such as assigning, for example `[2]T{} = []T{1}` will fail, however `[2]T{} == []T{1, 2}` (notice assigning *slice* to fixed size *array*). Assigning arrays to slices will always succeed if they are of the same element type. Incidentally also fixes #2379 --- accounts/abi/numbers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'accounts/abi/numbers.go') diff --git a/accounts/abi/numbers.go b/accounts/abi/numbers.go index 084701de5..5a31cf2b5 100644 --- a/accounts/abi/numbers.go +++ b/accounts/abi/numbers.go @@ -24,8 +24,8 @@ import ( ) var ( - big_t = reflect.TypeOf(&big.Int{}) - ubig_t = reflect.TypeOf(&big.Int{}) + big_t = reflect.TypeOf(big.Int{}) + ubig_t = reflect.TypeOf(big.Int{}) byte_t = reflect.TypeOf(byte(0)) byte_ts = reflect.TypeOf([]byte(nil)) uint_t = reflect.TypeOf(uint(0)) -- cgit