accouns/abi: refactored ABI package

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
This commit is contained in:
Jeffrey Wilcke
2016-04-07 11:39:22 +02:00
parent 18580e152c
commit 5127ec10cb
8 changed files with 491 additions and 314 deletions

View File

@ -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))