@@ -28,6 +28,7 @@ import (
28
28
graphdb "github.com/lightningnetwork/lnd/graph/db"
29
29
"github.com/lightningnetwork/lnd/graph/db/models"
30
30
"github.com/lightningnetwork/lnd/keychain"
31
+ "github.com/lightningnetwork/lnd/lnmock"
31
32
"github.com/lightningnetwork/lnd/lnpeer"
32
33
"github.com/lightningnetwork/lnd/lntest/mock"
33
34
"github.com/lightningnetwork/lnd/lntest/wait"
@@ -715,10 +716,12 @@ func mockFindChannel(node *btcec.PublicKey, chanID lnwire.ChannelID) (
715
716
}
716
717
717
718
type testCtx struct {
719
+ t * testing.T
718
720
gossiper * AuthenticatedGossiper
719
721
router * mockGraphSource
720
722
notifier * mockNotifier
721
723
broadcastedMessage chan msgWithSenders
724
+ chain * lnmock.MockChain
722
725
}
723
726
724
727
func createTestCtx (t * testing.T , startHeight uint32 , isChanPeer bool ) (
@@ -730,6 +733,10 @@ func createTestCtx(t *testing.T, startHeight uint32, isChanPeer bool) (
730
733
// broadcast functions won't be populated.
731
734
notifier := newMockNotifier ()
732
735
router := newMockRouter (startHeight )
736
+ chain := & lnmock.MockChain {}
737
+ t .Cleanup (func () {
738
+ chain .AssertExpectations (t )
739
+ })
733
740
734
741
db := channeldb .OpenForTesting (t , t .TempDir ())
735
742
@@ -761,6 +768,7 @@ func createTestCtx(t *testing.T, startHeight uint32, isChanPeer bool) (
761
768
}
762
769
763
770
gossiper := New (Config {
771
+ ChainIO : chain ,
764
772
Notifier : notifier ,
765
773
Broadcast : func (senders map [route.Vertex ]struct {},
766
774
msgs ... lnwire.Message ) error {
@@ -832,10 +840,12 @@ func createTestCtx(t *testing.T, startHeight uint32, isChanPeer bool) (
832
840
})
833
841
834
842
return & testCtx {
843
+ t : t ,
835
844
router : router ,
836
845
notifier : notifier ,
837
846
gossiper : gossiper ,
838
847
broadcastedMessage : broadcastedMessage ,
848
+ chain : chain ,
839
849
}, nil
840
850
}
841
851
0 commit comments