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
9eec013f
Unverified
Commit
9eec013f
authored
Oct 13, 2022
by
protolambda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
op-e2e: batcher action testing review fixes
parent
278c7e59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
l2_batcher.go
op-e2e/actions/l2_batcher.go
+10
-2
l2_batcher_test.go
op-e2e/actions/l2_batcher_test.go
+1
-0
No files found.
op-e2e/actions/l2_batcher.go
View file @
9eec013f
...
...
@@ -127,14 +127,22 @@ func (s *L2Batcher) ActL2BatchBuffer(t Testing) {
}
}
func
(
s
*
L2Batcher
)
ActL2ChannelClose
(
t
Testing
)
{
// Don't run this action if there's no data to submit
if
s
.
l2ChannelOut
==
nil
{
t
.
InvalidAction
(
"need to buffer data first, cannot batch submit with empty buffer"
)
return
}
require
.
NoError
(
t
,
s
.
l2ChannelOut
.
Close
(),
"must close channel before submitting it"
)
}
// ActL2BatchSubmit constructs a batch tx from previous buffered L2 blocks, and submits it to L1
func
(
s
*
L2Batcher
)
ActL2BatchSubmit
(
t
Testing
)
{
// Don't run this action if there's no data to submit
if
s
.
l2ChannelOut
==
nil
||
s
.
l2ChannelOut
.
ReadyBytes
()
==
0
{
if
s
.
l2ChannelOut
==
nil
{
t
.
InvalidAction
(
"need to buffer data first, cannot batch submit with empty buffer"
)
return
}
require
.
NoError
(
t
,
s
.
l2ChannelOut
.
Close
(),
"must close channel before submitting it"
)
// Collect the output frame
data
:=
new
(
bytes
.
Buffer
)
data
.
WriteByte
(
derive
.
DerivationVersion0
)
...
...
op-e2e/actions/l2_batcher_test.go
View file @
9eec013f
...
...
@@ -58,6 +58,7 @@ func TestBatcher(gt *testing.T) {
// batch submit to L1
batcher
.
ActL2BatchBuffer
(
t
)
batcher
.
ActL2ChannelClose
(
t
)
batcher
.
ActL2BatchSubmit
(
t
)
// confirm batch on L1
...
...
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