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
f7e4cb60
Commit
f7e4cb60
authored
Mar 14, 2023
by
Andreas Bigger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove explicit reference on instantiation for frameData
parent
ccba6519
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
channel_builder_test.go
op-batcher/batcher/channel_builder_test.go
+4
-10
No files found.
op-batcher/batcher/channel_builder_test.go
View file @
f7e4cb60
...
...
@@ -295,14 +295,14 @@ func TestBuilderNextFrame(t *testing.T) {
// Push one frame into to the channel builder
expectedTx
:=
txID
{
chID
:
co
.
ID
(),
frameNumber
:
fn
}
expectedBytes
:=
buf
.
Bytes
()
frameData
:=
&
frameData
{
frameData
:=
frameData
{
id
:
frameID
{
chID
:
co
.
ID
(),
frameNumber
:
fn
,
},
data
:
expectedBytes
,
}
cb
.
PushFrame
(
*
frameData
)
cb
.
PushFrame
(
frameData
)
// There should only be 1 frame in the channel builder
require
.
Equal
(
t
,
1
,
cb
.
NumFrames
())
...
...
@@ -336,22 +336,20 @@ func TestBuilderWrongFramePanic(t *testing.T) {
// The frame push should panic since we constructed a new channel out
// so the channel out id won't match
require
.
PanicsWithValue
(
t
,
"wrong channel"
,
func
()
{
frame
:=
&
frameData
{
frame
:=
frameData
{
id
:
frameID
{
chID
:
co
.
ID
(),
frameNumber
:
fn
,
},
data
:
buf
.
Bytes
(),
}
cb
.
PushFrame
(
*
frame
)
cb
.
PushFrame
(
frame
)
})
}
// TestOutputFrames tests the OutputFrames function
func
TestOutputFrames
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig
.
MaxFrameSize
=
2
// Construct the channel builder
...
...
@@ -401,8 +399,6 @@ func TestOutputFrames(t *testing.T) {
// function errors when the max RLP bytes per channel is reached.
func
TestMaxRLPBytesPerChannel
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig
.
MaxFrameSize
=
2
// Construct the channel builder
...
...
@@ -420,8 +416,6 @@ func TestMaxRLPBytesPerChannel(t *testing.T) {
// function errors when the max frame index is reached.
func
TestOutputFramesMaxFrameIndex
(
t
*
testing
.
T
)
{
channelConfig
:=
defaultTestChannelConfig
// Lower the max frame size so that we can test
channelConfig
.
MaxFrameSize
=
1
channelConfig
.
TargetNumFrames
=
math
.
MaxInt
channelConfig
.
TargetFrameSize
=
1
// math.MaxUint64
...
...
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