mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-29 07:00:55 +02:00
invoices: remove the global mock htlcModifierMock
This can create race in the tests.
This commit is contained in:
@@ -24,12 +24,6 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
var (
|
||||
// htlcModifierMock is a mock implementation of the invoice HtlcModifier
|
||||
// interface.
|
||||
htlcModifierMock = &invpkg.MockHtlcModifier{}
|
||||
)
|
||||
|
||||
// TestInvoiceRegistry is a master test which encompasses all tests using an
|
||||
// InvoiceDB instance. The purpose of this test is to be able to run all tests
|
||||
// with a custom DB instance, so that we can test the same logic with different
|
||||
@@ -541,7 +535,7 @@ func testSettleHoldInvoice(t *testing.T,
|
||||
cfg := invpkg.RegistryConfig{
|
||||
FinalCltvRejectDelta: testFinalCltvRejectDelta,
|
||||
Clock: clock,
|
||||
HtlcInterceptor: htlcModifierMock,
|
||||
HtlcInterceptor: &invpkg.MockHtlcModifier{},
|
||||
}
|
||||
|
||||
expiryWatcher := invpkg.NewInvoiceExpiryWatcher(
|
||||
@@ -711,7 +705,7 @@ func testCancelHoldInvoice(t *testing.T,
|
||||
cfg := invpkg.RegistryConfig{
|
||||
FinalCltvRejectDelta: testFinalCltvRejectDelta,
|
||||
Clock: testClock,
|
||||
HtlcInterceptor: htlcModifierMock,
|
||||
HtlcInterceptor: &invpkg.MockHtlcModifier{},
|
||||
}
|
||||
expiryWatcher := invpkg.NewInvoiceExpiryWatcher(
|
||||
cfg.Clock, 0, uint32(testCurrentHeight), nil, newMockNotifier(),
|
||||
@@ -1231,7 +1225,7 @@ func testInvoiceExpiryWithRegistry(t *testing.T,
|
||||
cfg := invpkg.RegistryConfig{
|
||||
FinalCltvRejectDelta: testFinalCltvRejectDelta,
|
||||
Clock: testClock,
|
||||
HtlcInterceptor: htlcModifierMock,
|
||||
HtlcInterceptor: &invpkg.MockHtlcModifier{},
|
||||
}
|
||||
|
||||
expiryWatcher := invpkg.NewInvoiceExpiryWatcher(
|
||||
@@ -1342,7 +1336,7 @@ func testOldInvoiceRemovalOnStart(t *testing.T,
|
||||
FinalCltvRejectDelta: testFinalCltvRejectDelta,
|
||||
Clock: testClock,
|
||||
GcCanceledInvoicesOnStartup: true,
|
||||
HtlcInterceptor: htlcModifierMock,
|
||||
HtlcInterceptor: &invpkg.MockHtlcModifier{},
|
||||
}
|
||||
|
||||
expiryWatcher := invpkg.NewInvoiceExpiryWatcher(
|
||||
|
Reference in New Issue
Block a user