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
bb77ca44
Commit
bb77ca44
authored
Mar 01, 2023
by
Joshua Gutow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to require.NoError
parent
b23440e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
channel_manager_test.go
op-batcher/batcher/channel_manager_test.go
+9
-8
No files found.
op-batcher/batcher/channel_manager_test.go
View file @
bb77ca44
package
batcher_test
package
batcher_test
import
(
import
(
"io"
"math/big"
"math/big"
"testing"
"testing"
...
@@ -38,11 +39,11 @@ func TestChannelManagerReturnsErrReorg(t *testing.T) {
...
@@ -38,11 +39,11 @@ func TestChannelManagerReturnsErrReorg(t *testing.T) {
},
nil
,
nil
,
nil
,
nil
)
},
nil
,
nil
,
nil
,
nil
)
err
:=
m
.
AddL2Block
(
a
)
err
:=
m
.
AddL2Block
(
a
)
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
err
=
m
.
AddL2Block
(
b
)
err
=
m
.
AddL2Block
(
b
)
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
err
=
m
.
AddL2Block
(
c
)
err
=
m
.
AddL2Block
(
c
)
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
err
=
m
.
AddL2Block
(
x
)
err
=
m
.
AddL2Block
(
x
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
}
}
...
@@ -50,7 +51,7 @@ func TestChannelManagerReturnsErrReorg(t *testing.T) {
...
@@ -50,7 +51,7 @@ func TestChannelManagerReturnsErrReorg(t *testing.T) {
// TestChannelManagerReturnsErrReorgWhenDrained ensures that the channel manager
// TestChannelManagerReturnsErrReorgWhenDrained ensures that the channel manager
// detects a reorg even if it does not have any blocks inside it.
// detects a reorg even if it does not have any blocks inside it.
func
TestChannelManagerReturnsErrReorgWhenDrained
(
t
*
testing
.
T
)
{
func
TestChannelManagerReturnsErrReorgWhenDrained
(
t
*
testing
.
T
)
{
log
:=
testlog
.
Logger
(
t
,
log
.
Lvl
Trace
)
log
:=
testlog
.
Logger
(
t
,
log
.
Lvl
Crit
)
m
:=
batcher
.
NewChannelManager
(
log
,
batcher
.
ChannelConfig
{
m
:=
batcher
.
NewChannelManager
(
log
,
batcher
.
ChannelConfig
{
TargetFrameSize
:
0
,
TargetFrameSize
:
0
,
MaxFrameSize
:
100
,
MaxFrameSize
:
100
,
...
@@ -62,7 +63,7 @@ func TestChannelManagerReturnsErrReorgWhenDrained(t *testing.T) {
...
@@ -62,7 +63,7 @@ func TestChannelManagerReturnsErrReorgWhenDrained(t *testing.T) {
Number
:
big
.
NewInt
(
100
),
Number
:
big
.
NewInt
(
100
),
},
nil
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
},
nil
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
l1InfoTx
,
err
:=
derive
.
L1InfoDeposit
(
0
,
lBlock
,
eth
.
SystemConfig
{},
false
)
l1InfoTx
,
err
:=
derive
.
L1InfoDeposit
(
0
,
lBlock
,
eth
.
SystemConfig
{},
false
)
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
txs
:=
[]
*
types
.
Transaction
{
types
.
NewTx
(
l1InfoTx
)}
txs
:=
[]
*
types
.
Transaction
{
types
.
NewTx
(
l1InfoTx
)}
a
:=
types
.
NewBlock
(
&
types
.
Header
{
a
:=
types
.
NewBlock
(
&
types
.
Header
{
...
@@ -74,11 +75,11 @@ func TestChannelManagerReturnsErrReorgWhenDrained(t *testing.T) {
...
@@ -74,11 +75,11 @@ func TestChannelManagerReturnsErrReorgWhenDrained(t *testing.T) {
},
txs
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
},
txs
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
err
=
m
.
AddL2Block
(
a
)
err
=
m
.
AddL2Block
(
a
)
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
require
.
N
il
(
t
,
err
)
require
.
N
oError
(
t
,
err
)
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
require
.
ErrorIs
(
t
,
err
,
io
.
EOF
)
require
.
ErrorIs
(
t
,
err
,
io
.
EOF
)
err
=
m
.
AddL2Block
(
x
)
err
=
m
.
AddL2Block
(
x
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
...
...
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