Skip to content

Commit 06a7460

Browse files
Add IPAddressRegistry field to test
1 parent d1397f0 commit 06a7460

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

l1/l1_test.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"github.com/NethermindEth/juno/l1"
1717
"github.com/NethermindEth/juno/l1/contract"
1818
"github.com/NethermindEth/juno/mocks"
19+
"github.com/NethermindEth/juno/p2p"
1920
"github.com/NethermindEth/juno/utils"
2021
"github.com/ethereum/go-ethereum/common"
2122
"github.com/ethereum/go-ethereum/core/types"
@@ -110,6 +111,7 @@ func TestEventListener(t *testing.T) {
110111
ctrl := gomock.NewController(t)
111112
nopLog := utils.NewNopZapLogger()
112113
network := utils.Mainnet
114+
network.IPAddressRegistry = &common.Address{}
113115
chain := blockchain.New(pebble.NewMemTest(t), &network, nil)
114116

115117
subscriber := mocks.NewMockSubscriber(ctrl)
@@ -126,6 +128,24 @@ func TestEventListener(t *testing.T) {
126128
Return(newFakeSubscription(), nil).
127129
Times(1)
128130

131+
subscriber.
132+
EXPECT().
133+
GetIPAddresses(gomock.Any(), gomock.Any()).
134+
Return([]string{}, nil).
135+
Times(1)
136+
137+
subscriber.
138+
EXPECT().
139+
WatchIPAdded(gomock.Any(), gomock.Any()).
140+
Return(newFakeSubscription(), nil).
141+
Times(1)
142+
143+
subscriber.
144+
EXPECT().
145+
WatchIPRemoved(gomock.Any(), gomock.Any()).
146+
Return(newFakeSubscription(), nil).
147+
Times(1)
148+
129149
subscriber.
130150
EXPECT().
131151
FinalisedHeight(gomock.Any()).
@@ -141,7 +161,7 @@ func TestEventListener(t *testing.T) {
141161
subscriber.EXPECT().Close().Times(1)
142162

143163
var got *core.L1Head
144-
client := l1.NewClient(subscriber, chain, nopLog, nil).
164+
client := l1.NewClient(subscriber, chain, nopLog, make(chan<- p2p.IPAddressRegistryEvent)).
145165
WithResubscribeDelay(0).
146166
WithPollFinalisedInterval(time.Nanosecond).
147167
WithEventListener(l1.SelectiveListener{

0 commit comments

Comments
 (0)