From 0b3816afb9479e88338898b39be7f07171492e58 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 10 Sep 2025 18:23:28 -0700 Subject: [PATCH] discovery/test: update mock to support iterator-based UpdatesInHorizon In this commit, we update the mockChannelGraphTimeSeries to implement the new iterator-based UpdatesInHorizon interface. The mock maintains its existing behavior of receiving messages through a channel and returning them to the caller, but now wraps this in an iterator function. The implementation creates an iterator that pulls the entire message slice from the mock's response channel, then yields each message individually. This preserves the test semantics while conforming to the new interface, ensuring all existing tests continue to pass without modification. --- discovery/syncer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/discovery/syncer_test.go b/discovery/syncer_test.go index 72ad2ce47..faef40bbe 100644 --- a/discovery/syncer_test.go +++ b/discovery/syncer_test.go @@ -94,6 +94,8 @@ func (m *mockChannelGraphTimeSeries) UpdatesInHorizon(chain chainhash.Hash, chain, startTime, endTime, } + // We'll get the response from the channel, then yield it + // immediately. msgs := <-m.horizonResp for _, msg := range msgs { if !yield(msg, nil) {