Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
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
vicotor
mybee
Commits
54486d7a
Unverified
Commit
54486d7a
authored
Apr 09, 2020
by
Zahoor Mohamed
Committed by
GitHub
Apr 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
P2 - remove rlp dependency from shed package (#72)
parent
4c75c749
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
field_struct.go
pkg/shed/field_struct.go
+4
-4
No files found.
pkg/shed/field_struct.go
View file @
54486d7a
...
...
@@ -17,7 +17,7 @@
package
shed
import
(
"
github.com/ethereum/go-ethereum/rlp
"
"
encoding/json
"
"github.com/syndtr/goleveldb/leveldb"
)
...
...
@@ -48,12 +48,12 @@ func (f StructField) Get(val interface{}) (err error) {
if
err
!=
nil
{
return
err
}
return
rlp
.
DecodeBytes
(
b
,
val
)
return
json
.
Unmarshal
(
b
,
val
)
}
// Put marshals provided val and saves it to the database.
func
(
f
StructField
)
Put
(
val
interface
{})
(
err
error
)
{
b
,
err
:=
rlp
.
EncodeToBytes
(
val
)
b
,
err
:=
json
.
Marshal
(
val
)
if
err
!=
nil
{
return
err
}
...
...
@@ -62,7 +62,7 @@ func (f StructField) Put(val interface{}) (err error) {
// PutInBatch marshals provided val and puts it into the batch.
func
(
f
StructField
)
PutInBatch
(
batch
*
leveldb
.
Batch
,
val
interface
{})
(
err
error
)
{
b
,
err
:=
rlp
.
EncodeToBytes
(
val
)
b
,
err
:=
json
.
Marshal
(
val
)
if
err
!=
nil
{
return
err
}
...
...
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