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
b7e02f6f
Commit
b7e02f6f
authored
Dec 04, 2023
by
pcw109550
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-node: JSON Marshaling for span batch
parent
874fb900
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
span_batch.go
op-node/rollup/derive/span_batch.go
+17
-0
No files found.
op-node/rollup/derive/span_batch.go
View file @
b7e02f6f
...
@@ -3,6 +3,7 @@ package derive
...
@@ -3,6 +3,7 @@ package derive
import
(
import
(
"bytes"
"bytes"
"encoding/binary"
"encoding/binary"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
"io"
"io"
...
@@ -452,6 +453,22 @@ type SpanBatch struct {
...
@@ -452,6 +453,22 @@ type SpanBatch struct {
Batches
[]
*
SpanBatchElement
// List of block input in derived form
Batches
[]
*
SpanBatchElement
// List of block input in derived form
}
}
// spanBatchMarshaling is a helper type used for JSON marshaling.
type
spanBatchMarshaling
struct
{
ParentCheck
[]
hexutil
.
Bytes
`json:"parent_check"`
L1OriginCheck
[]
hexutil
.
Bytes
`json:"l1_origin_check"`
Batches
[]
*
SpanBatchElement
`json:"span_batch_elements"`
}
func
(
b
*
SpanBatch
)
MarshalJSON
()
([]
byte
,
error
)
{
spanBatch
:=
spanBatchMarshaling
{
ParentCheck
:
[]
hexutil
.
Bytes
{
b
.
ParentCheck
[
:
]},
L1OriginCheck
:
[]
hexutil
.
Bytes
{
b
.
L1OriginCheck
[
:
]},
Batches
:
b
.
Batches
,
}
return
json
.
Marshal
(
spanBatch
)
}
// GetBatchType returns its batch type (batch_version)
// GetBatchType returns its batch type (batch_version)
func
(
b
*
SpanBatch
)
GetBatchType
()
int
{
func
(
b
*
SpanBatch
)
GetBatchType
()
int
{
return
SpanBatchType
return
SpanBatchType
...
...
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