Skip to content

Commit 4bd02df

Browse files
committed
Remove unneeded functions that were enabling testing
1 parent 3640f98 commit 4bd02df

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

sentinel/sentinel.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,6 @@ func (s *Sentinel) Unsubscribe(chainID int64, address common.Address, topic comm
107107
return eps.SubscriptionManager().Unsubscribe(address, topic, ch)
108108
}
109109

110-
// GetService gets the chain poller service for a chain id.
111-
func (s *Sentinel) GetService(chainID int64) (*chain_poller_service.ChainPollerService, bool) {
112-
s.mu.RLock()
113-
eps, exists := s.services[chainID]
114-
s.mu.RUnlock()
115-
116-
return eps, exists
117-
}
118-
119-
// HasServices returns true if there is at least 1 service running.
120-
func (s *Sentinel) HasServices() bool {
121-
s.mu.RLock()
122-
defer s.mu.RUnlock()
123-
124-
return len(s.services) > 0
125-
}
126-
127110
// Close shuts down all chains and the global registry.
128111
func (s *Sentinel) Close() {
129112
s.mu.Lock()

sentinel/sentinel_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestAddChain_SubscribeUnsubscribeEvent(t *testing.T) {
115115
log := createLog(1, common.HexToHash("0x1234"), address, []common.Hash{topic}, []byte("event data"), 0)
116116

117117
// Retrieve the chain service to access the Subscription Manager.
118-
chainService, exists := s.GetService(1)
118+
chainService, exists := s.services[1]
119119
require.True(t, exists, "Chain service should exist")
120120

121121
// Broadcast the log.
@@ -175,9 +175,9 @@ func TestAddChains_MultipleConsumers(t *testing.T) {
175175
logEvent2 := createLog(3, common.HexToHash("0x2345"), address2, []common.Hash{topic2}, []byte("another log data 2"), 0)
176176
logEvent3 := createLog(4, common.HexToHash("0x3456"), address3, []common.Hash{topic3}, []byte("another log data 3"), 0)
177177

178-
chainService1, exists1 := s.GetService(1)
178+
chainService1, exists1 := s.services[1]
179179
require.True(t, exists1, "Chain service 1 should exist")
180-
chainService2, exists2 := s.GetService(2)
180+
chainService2, exists2 := s.services[2]
181181
require.True(t, exists2, "Chain service 2 should exist")
182182

183183
chainService1.SubscriptionMgr.BroadcastLog(createEventKey(address1, topic1), logEvent1)
@@ -259,5 +259,5 @@ func TestAddMultipleChains_CloseSentinel(t *testing.T) {
259259
s.Close()
260260

261261
// Verify that all chains are cleaned up.
262-
assert.False(t, s.HasServices(), "All chains should be cleaned up after Close")
262+
assert.False(t, len(s.services) > 0, "All chains should be cleaned up after Close")
263263
}

0 commit comments

Comments
 (0)