From a55c461a8f1972eca37659fab5de43bd6c750e31 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Mon, 2 Sep 2024 18:49:22 +0200 Subject: [PATCH] test: support incomplete mocks Updating the mocks to be complete implementation of the underlying interfaces is not always possible due to cross dependency issues. This commit embeds the interfaces into the mocks so we can at least always compile them. --- test/chainnotifier_mock.go | 2 ++ test/invoices_mock.go | 2 ++ test/signer_mock.go | 2 ++ test/versioner_mock.go | 2 ++ test/walletkit_mock.go | 2 ++ 5 files changed, 10 insertions(+) diff --git a/test/chainnotifier_mock.go b/test/chainnotifier_mock.go index f155d11b..bc825562 100644 --- a/test/chainnotifier_mock.go +++ b/test/chainnotifier_mock.go @@ -13,6 +13,8 @@ import ( ) type mockChainNotifier struct { + lndclient.ChainNotifierClient + sync.Mutex lnd *LndMockServices confRegistrations []*ConfRegistration diff --git a/test/invoices_mock.go b/test/invoices_mock.go index f8d7920e..cbab3df1 100644 --- a/test/invoices_mock.go +++ b/test/invoices_mock.go @@ -15,6 +15,8 @@ import ( ) type mockInvoices struct { + lndclient.InvoicesClient + lnd *LndMockServices wg sync.WaitGroup } diff --git a/test/signer_mock.go b/test/signer_mock.go index 985e8577..9d91139f 100644 --- a/test/signer_mock.go +++ b/test/signer_mock.go @@ -15,6 +15,8 @@ import ( ) type mockSigner struct { + lndclient.SignerClient + lnd *LndMockServices } diff --git a/test/versioner_mock.go b/test/versioner_mock.go index 7722e032..8f06d764 100644 --- a/test/versioner_mock.go +++ b/test/versioner_mock.go @@ -25,6 +25,8 @@ var ( ) type mockVersioner struct { + lndclient.VersionerClient + version *verrpc.Version } diff --git a/test/walletkit_mock.go b/test/walletkit_mock.go index c26f7b44..5a2887be 100644 --- a/test/walletkit_mock.go +++ b/test/walletkit_mock.go @@ -27,6 +27,8 @@ import ( var DefaultMockFee = chainfee.SatPerKWeight(10000) type mockWalletKit struct { + lndclient.WalletKitClient + lnd *LndMockServices keyIndex int32