@@ -16,6 +16,7 @@ import (
16
16
"github.com/NethermindEth/juno/l1"
17
17
"github.com/NethermindEth/juno/l1/contract"
18
18
"github.com/NethermindEth/juno/mocks"
19
+ "github.com/NethermindEth/juno/p2p"
19
20
"github.com/NethermindEth/juno/utils"
20
21
"github.com/ethereum/go-ethereum/common"
21
22
"github.com/ethereum/go-ethereum/core/types"
@@ -110,6 +111,7 @@ func TestEventListener(t *testing.T) {
110
111
ctrl := gomock .NewController (t )
111
112
nopLog := utils .NewNopZapLogger ()
112
113
network := utils .Mainnet
114
+ network .IPAddressRegistry = & common.Address {}
113
115
chain := blockchain .New (pebble .NewMemTest (t ), & network , nil )
114
116
115
117
subscriber := mocks .NewMockSubscriber (ctrl )
@@ -126,6 +128,24 @@ func TestEventListener(t *testing.T) {
126
128
Return (newFakeSubscription (), nil ).
127
129
Times (1 )
128
130
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
+
129
149
subscriber .
130
150
EXPECT ().
131
151
FinalisedHeight (gomock .Any ()).
@@ -141,7 +161,7 @@ func TestEventListener(t *testing.T) {
141
161
subscriber .EXPECT ().Close ().Times (1 )
142
162
143
163
var got * core.L1Head
144
- client := l1 .NewClient (subscriber , chain , nopLog , nil ).
164
+ client := l1 .NewClient (subscriber , chain , nopLog , make ( chan <- p2p. IPAddressRegistryEvent ) ).
145
165
WithResubscribeDelay (0 ).
146
166
WithPollFinalisedInterval (time .Nanosecond ).
147
167
WithEventListener (l1.SelectiveListener {
0 commit comments