Commit 79476c17 authored by Hamdi Allam's avatar Hamdi Allam

ci fixes

parent cd009053
...@@ -29,7 +29,7 @@ func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflec ...@@ -29,7 +29,7 @@ func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflec
b, err := hexutil.Decode(hexStr) b, err := hexutil.Decode(hexStr)
if err != nil { if err != nil {
return fmt.Errorf("failed to decode database value: %s", err) return fmt.Errorf("failed to decode database value: %w", err)
} }
fieldValue := reflect.New(field.FieldType) fieldValue := reflect.New(field.FieldType)
...@@ -43,8 +43,8 @@ func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflec ...@@ -43,8 +43,8 @@ func (BytesSerializer) Scan(ctx context.Context, field *schema.Field, dst reflec
return fmt.Errorf("double pointers are the max depth supported: %T", fieldValue) return fmt.Errorf("double pointers are the max depth supported: %T", fieldValue)
} }
// We'll want to call `SetBytes` on the pointer to the // We'll want to call `SetBytes` on the pointer to
// allocated structmemory and not the douple pointer // the allocated memory and not the double pointer
nestedField.Set(reflect.New(field.FieldType.Elem())) nestedField.Set(reflect.New(field.FieldType.Elem()))
fieldInterface = nestedField.Interface() fieldInterface = nestedField.Interface()
} }
......
...@@ -29,12 +29,12 @@ func (RLPSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect. ...@@ -29,12 +29,12 @@ func (RLPSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.
b, err := hexutil.Decode(hexStr) b, err := hexutil.Decode(hexStr)
if err != nil { if err != nil {
return fmt.Errorf("failed to decode database value: %s", err) return fmt.Errorf("failed to decode database value: %w", err)
} }
fieldValue := reflect.New(field.FieldType) fieldValue := reflect.New(field.FieldType)
if err := rlp.DecodeBytes(b, fieldValue.Interface()); err != nil { if err := rlp.DecodeBytes(b, fieldValue.Interface()); err != nil {
return fmt.Errorf("failed to decode rlp bytes: %s", err) return fmt.Errorf("failed to decode rlp bytes: %w", err)
} }
field.ReflectValueOf(ctx, dst).Set(fieldValue.Elem()) field.ReflectValueOf(ctx, dst).Set(fieldValue.Elem())
...@@ -48,7 +48,7 @@ func (RLPSerializer) Value(ctx context.Context, field *schema.Field, dst reflect ...@@ -48,7 +48,7 @@ func (RLPSerializer) Value(ctx context.Context, field *schema.Field, dst reflect
rlpBytes, err := rlp.EncodeToBytes(fieldValue) rlpBytes, err := rlp.EncodeToBytes(fieldValue)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to encode rlp bytes: %s", err) return nil, fmt.Errorf("failed to encode rlp bytes: %w", err)
} }
hexStr := hexutil.Encode(rlpBytes) hexStr := hexutil.Encode(rlpBytes)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment