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
c2379572
Commit
c2379572
authored
Mar 21, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nomenclature
parent
a9db57ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
channel_builder_test.go
op-batcher/batcher/channel_builder_test.go
+16
-16
No files found.
op-batcher/batcher/channel_builder_test.go
View file @
c2379572
...
...
@@ -132,10 +132,10 @@ func FuzzDurationTimeoutZeroMaxChannelDuration(f *testing.F) {
})
}
// FuzzDurationZero ensures that when whenever the MaxChannelDuration
// Fuzz
ChannelBuilder_
DurationZero ensures that when whenever the MaxChannelDuration
// is not set to 0, the channel builder will always have a duration timeout
// as long as the channel builder's timeout is set to 0.
func
FuzzDurationZero
(
f
*
testing
.
F
)
{
func
Fuzz
ChannelBuilder_
DurationZero
(
f
*
testing
.
F
)
{
for
i
:=
range
[
10
]
int
{}
{
f
.
Add
(
uint64
(
i
),
uint64
(
i
))
}
...
...
@@ -313,8 +313,8 @@ func FuzzSeqWindowZeroTimeoutClose(f *testing.F) {
})
}
// Test
Builder
NextFrame tests calling NextFrame on a ChannelBuilder with only one frame
func
Test
Builder
NextFrame
(
t
*
testing
.
T
)
{
// Test
ChannelBuilder_
NextFrame tests calling NextFrame on a ChannelBuilder with only one frame
func
Test
ChannelBuilder_
NextFrame
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Create a new channel builder
...
...
@@ -353,8 +353,8 @@ func TestBuilderNextFrame(t *testing.T) {
require
.
PanicsWithValue
(
t
,
"no next frame"
,
func
()
{
cb
.
NextFrame
()
})
}
// Test
BuilderInvalidFrameId
tests that a panic is thrown when a frame is pushed with an invalid frame id
func
Test
Builder
WrongFramePanic
(
t
*
testing
.
T
)
{
// Test
ChannelBuilder_OutputWrongFramePanic
tests that a panic is thrown when a frame is pushed with an invalid frame id
func
Test
ChannelBuilder_Output
WrongFramePanic
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Construct a channel builder
...
...
@@ -383,8 +383,8 @@ func TestBuilderWrongFramePanic(t *testing.T) {
})
}
// Test
OutputFramesHappy tests the OutputFrames function happy path
func
Test
OutputFramesHappy
(
t
*
testing
.
T
)
{
// Test
ChannelBuilder_OutputFramesWorks tests the [ChannelBuilder] OutputFrames is successful.
func
Test
ChannelBuilder_OutputFramesWorks
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
channelConfig
.
MaxFrameSize
=
24
...
...
@@ -424,9 +424,9 @@ func TestOutputFramesHappy(t *testing.T) {
}
}
// TestMaxRLPBytesPerChannel tests the [channelBuilder.OutputFrames]
// Test
ChannelBuilder_
MaxRLPBytesPerChannel tests the [channelBuilder.OutputFrames]
// function errors when the max RLP bytes per channel is reached.
func
TestMaxRLPBytesPerChannel
(
t
*
testing
.
T
)
{
func
Test
ChannelBuilder_
MaxRLPBytesPerChannel
(
t
*
testing
.
T
)
{
t
.
Parallel
()
channelConfig
:=
defaultTestChannelConfig
channelConfig
.
MaxFrameSize
=
derive
.
MaxRLPBytesPerChannel
*
2
...
...
@@ -442,9 +442,9 @@ func TestMaxRLPBytesPerChannel(t *testing.T) {
require
.
ErrorIs
(
t
,
err
,
derive
.
ErrTooManyRLPBytes
)
}
// Test
OutputFramesMaxFrameIndex tests the [c
hannelBuilder.OutputFrames]
// Test
ChannelBuilder_OutputFramesMaxFrameIndex tests the [C
hannelBuilder.OutputFrames]
// function errors when the max frame index is reached.
func
TestOutputFramesMaxFrameIndex
(
t
*
testing
.
T
)
{
func
Test
ChannelBuilder_
OutputFramesMaxFrameIndex
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
channelConfig
.
MaxFrameSize
=
24
channelConfig
.
TargetNumFrames
=
math
.
MaxInt
...
...
@@ -483,8 +483,8 @@ func TestOutputFramesMaxFrameIndex(t *testing.T) {
}
}
// Test
Builder
AddBlock tests the AddBlock function
func
Test
Builder
AddBlock
(
t
*
testing
.
T
)
{
// Test
ChannelBuilder_
AddBlock tests the AddBlock function
func
Test
ChannelBuilder_
AddBlock
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Lower the max frame size so that we can batch
...
...
@@ -514,8 +514,8 @@ func TestBuilderAddBlock(t *testing.T) {
require
.
ErrorIs
(
t
,
addMiniBlock
(
cb
),
ErrInputTargetReached
)
}
// Test
BuilderReset tests the Reset
function
func
Test
Builder
Reset
(
t
*
testing
.
T
)
{
// Test
ChannelBuilder_Reset tests the [Reset]
function
func
Test
ChannelBuilder_
Reset
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Lower the max frame size so that we can batch
...
...
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