accounts/abi: fixed string and fixed size bytes packing

This commit is contained in:
Jeffrey Wilcke
2016-04-20 21:30:02 +02:00
parent c3d5250473
commit 4880868c88
6 changed files with 138 additions and 86 deletions

View File

@ -58,7 +58,7 @@ func (m Method) pack(method Method, args ...interface{}) ([]byte, error) {
}
// check for a slice type (string, bytes, slice)
if input.Type.T == StringTy || input.Type.T == BytesTy || input.Type.IsSlice || input.Type.IsArray {
if input.Type.requiresLengthPrefix() {
// calculate the offset
offset := len(method.Inputs)*32 + len(variableInput)
// set the offset