accounts/abi: update array type check in method.go. Add more packing tests

This commit is contained in:
Yondon Fu
2017-12-18 21:16:25 -05:00
parent 3857cdc267
commit cf7aba36c8
2 changed files with 138 additions and 6 deletions

View File

@ -51,8 +51,8 @@ func (method Method) pack(args ...interface{}) ([]byte, error) {
// input offset is the bytes offset for packed output
inputOffset := 0
for _, input := range method.Inputs {
if input.Type.IsArray {
inputOffset += (32 * input.Type.SliceSize)
if input.Type.T == ArrayTy {
inputOffset += (32 * input.Type.Size)
} else {
inputOffset += 32
}