Update types.go

This commit is contained in:
crStiv 2025-01-05 01:47:19 +01:00 committed by GitHub
parent 341647f186
commit b2457f32ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 0 deletions

View File

@ -498,6 +498,16 @@ func (typedData *TypedData) encodeArrayValue(encValue interface{}, encType strin
arrayBuffer := new(bytes.Buffer)
parsedType := strings.Split(encType, "[")[0]
// Special handling for bytes arrays
if parsedType == "bytes" {
bytesValue, err := typedData.EncodePrimitiveValue(encType, encValue, depth)
if err != nil {
return nil, err
}
return bytesValue, nil
}
for _, item := range arrayValue {
if reflect.TypeOf(item).Kind() == reflect.Slice ||
reflect.TypeOf(item).Kind() == reflect.Array {