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
493193b5
Commit
493193b5
authored
Mar 14, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove formatted error checks
parent
389e97fe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
channel_builder_test.go
op-batcher/batcher/channel_builder_test.go
+8
-8
No files found.
op-batcher/batcher/channel_builder_test.go
View file @
493193b5
...
...
@@ -118,7 +118,7 @@ func FuzzDuration(f *testing.F) {
cb
.
timeout
=
0
cb
.
updateDurationTimeout
(
l1BlockNum
)
cb
.
checkTimeout
(
l1BlockNum
+
maxChannelDuration
)
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrMaxDurationReached
,
"Max channel duration should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrMaxDurationReached
)
})
}
...
...
@@ -152,7 +152,7 @@ func FuzzDurationTimeout(f *testing.F) {
// with no timeoutReason. This subsequently causes a panic when
// a nil timeoutReason is used as an error (eg when calling FullErr).
cb
.
checkTimeout
(
l1BlockNum
+
maxChannelDuration
)
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrMaxDurationReached
,
"Max channel duration should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrMaxDurationReached
)
}
else
{
require
.
NoError
(
t
,
cb
.
FullErr
())
}
...
...
@@ -181,7 +181,7 @@ func FuzzChannelTimeoutClose(f *testing.F) {
calculatedTimeout
:=
l1BlockNum
+
channelTimeout
-
subSafetyMargin
if
timeout
>
calculatedTimeout
{
cb
.
checkTimeout
(
calculatedTimeout
)
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrChannelTimeoutClose
,
"Channel timeout close should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrChannelTimeoutClose
)
}
else
{
require
.
NoError
(
t
,
cb
.
FullErr
())
}
...
...
@@ -209,7 +209,7 @@ func FuzzChannelTimeoutCloseZeroTimeout(f *testing.F) {
calculatedTimeout
:=
l1BlockNum
+
channelTimeout
-
subSafetyMargin
cb
.
checkTimeout
(
calculatedTimeout
)
if
cb
.
timeout
!=
0
{
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrChannelTimeoutClose
,
"Channel timeout close should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrChannelTimeoutClose
)
}
})
}
...
...
@@ -240,7 +240,7 @@ func FuzzSeqWindowClose(f *testing.F) {
calculatedTimeout
:=
epochNum
+
seqWindowSize
-
subSafetyMargin
if
timeout
>
calculatedTimeout
{
cb
.
checkTimeout
(
calculatedTimeout
)
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrSeqWindowClose
,
"Sequence window close should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrSeqWindowClose
)
}
else
{
require
.
NoError
(
t
,
cb
.
FullErr
())
}
...
...
@@ -272,7 +272,7 @@ func FuzzSeqWindowCloseZeroTimeout(f *testing.F) {
calculatedTimeout
:=
epochNum
+
seqWindowSize
-
subSafetyMargin
cb
.
checkTimeout
(
calculatedTimeout
)
if
cb
.
timeout
!=
0
{
require
.
ErrorIs
f
(
t
,
cb
.
FullErr
(),
ErrSeqWindowClose
,
"Sequence window close should be reached"
)
require
.
ErrorIs
(
t
,
cb
.
FullErr
(),
ErrSeqWindowClose
)
}
})
}
...
...
@@ -413,7 +413,7 @@ func TestMaxRLPBytesPerChannel(t *testing.T) {
// Add a block that overflows the [ChannelOut]
err
=
buildTooLargeRlpEncodedBlockBatch
(
cb
)
require
.
ErrorIs
f
(
t
,
err
,
derive
.
ErrTooManyRLPBytes
,
"err: %v"
,
err
)
require
.
ErrorIs
(
t
,
err
,
derive
.
ErrTooManyRLPBytes
)
}
// TestOutputFramesMaxFrameIndex tests the [channelBuilder.OutputFrames]
...
...
@@ -448,7 +448,7 @@ func TestOutputFramesMaxFrameIndex(t *testing.T) {
err
=
cb
.
AddBlock
(
a
)
if
cb
.
IsFull
()
{
fullErr
:=
cb
.
FullErr
()
require
.
ErrorIs
f
(
t
,
fullErr
,
ErrMaxFrameIndex
,
"err: %v"
,
fullErr
)
require
.
ErrorIs
(
t
,
fullErr
,
ErrMaxFrameIndex
)
break
}
require
.
NoError
(
t
,
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