accounts/abi: differentiate between static and dynamic arrays (#3121)

solves #3119

Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
RJ
2016-11-03 17:25:19 -05:00
committed by Jeffrey Wilcke
parent ed2bc7fbe9
commit 2ad5dba50a
4 changed files with 65 additions and 27 deletions

View File

@ -78,10 +78,6 @@ func set(dst, src reflect.Value, output Argument) error {
case dstType.AssignableTo(src.Type()):
dst.Set(src)
case dstType.Kind() == reflect.Array && srcType.Kind() == reflect.Slice:
if !dstType.Elem().AssignableTo(r_byte) {
return fmt.Errorf("abi: cannot unmarshal %v in to array of elem %v", src.Type(), dstType.Elem())
}
if dst.Len() < output.Type.SliceSize {
return fmt.Errorf("abi: cannot unmarshal src (len=%d) in to dst (len=%d)", output.Type.SliceSize, dst.Len())
}