Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
79476c17
Commit
79476c17
authored
Aug 21, 2023
by
Hamdi Allam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ci fixes
parent
cd009053
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
bytes.go
indexer/database/serializers/bytes.go
+3
-3
rlp.go
indexer/database/serializers/rlp.go
+3
-3
No files found.
indexer/database/serializers/bytes.go
View file @
79476c17
...
@@ -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 doup
le pointer
//
the allocated memory and not the doub
le pointer
nestedField
.
Set
(
reflect
.
New
(
field
.
FieldType
.
Elem
()))
nestedField
.
Set
(
reflect
.
New
(
field
.
FieldType
.
Elem
()))
fieldInterface
=
nestedField
.
Interface
()
fieldInterface
=
nestedField
.
Interface
()
}
}
...
...
indexer/database/serializers/rlp.go
View file @
79476c17
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment