Skip to content

Commit cece1d3

Browse files
TestProcessor_BackwardLET, backward LET on empty bridge table
1 parent 2e39f39 commit cece1d3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

bridgesync/processor_test.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5377,7 +5377,7 @@ func TestProcessor_BackwardLET(t *testing.T) {
53775377
collectExpectedBridgesUpTo := func(t *testing.T, blocks []sync.Block, targetDepositCount uint32) []Bridge {
53785378
t.Helper()
53795379

5380-
var bridges []Bridge
5380+
bridges := make([]Bridge, 0)
53815381
for _, b := range blocks {
53825382
for _, e := range b.Events {
53835383
evt, ok := e.(Event)
@@ -5498,6 +5498,25 @@ func TestProcessor_BackwardLET(t *testing.T) {
54985498
},
54995499
targetDepositCount: 3,
55005500
},
5501+
{
5502+
name: "backward let on empty bridge table",
5503+
setupBlocks: func() []sync.Block {
5504+
return []sync.Block{
5505+
{
5506+
Num: 1,
5507+
Hash: common.HexToHash("0x1"),
5508+
Events: []any{
5509+
Event{BackwardLET: &BackwardLET{
5510+
BlockNum: 1,
5511+
BlockPos: 0,
5512+
PreviousDepositCount: big.NewInt(6),
5513+
NewDepositCount: big.NewInt(3),
5514+
}},
5515+
},
5516+
}}
5517+
},
5518+
targetDepositCount: 0,
5519+
},
55015520
{
55025521
name: "backward let after a couple of bridges + reorg backward let",
55035522
setupBlocks: func() []sync.Block {

0 commit comments

Comments
 (0)