mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
sweepbatcher: factor out loopdb-less version
Changed argument of function NewBatcher from LoopOutFetcher to SweepFetcher (returning new public type SweepInfo). This change is backwards-incompatible on the package layer, but nobody seems to use the package outside of Loop. To use NewBatcher inside Loop, turn loopdb into SweepFetcher using function NewSweepFetcherFromSwapStore.
This commit is contained in:
parent
295198a902
commit
0c2ba74dba
5 changed files with 309 additions and 88 deletions
|
|
@ -299,10 +299,15 @@ func testCustomSweepConfTarget(t *testing.T) {
|
|||
|
||||
batcherStore := sweepbatcher.NewStoreMock()
|
||||
|
||||
sweepStore, err := sweepbatcher.NewSweepFetcherFromSwapStore(
|
||||
cfg.store, lnd.ChainParams,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
batcher := sweepbatcher.NewBatcher(
|
||||
lnd.WalletKit, lnd.ChainNotifier, lnd.Signer,
|
||||
mockMuSig2SignSweep, mockVerifySchnorrSigSuccess,
|
||||
lnd.ChainParams, batcherStore, cfg.store,
|
||||
lnd.ChainParams, batcherStore, sweepStore,
|
||||
)
|
||||
|
||||
tctx, cancel := context.WithCancel(context.Background())
|
||||
|
|
@ -532,10 +537,15 @@ func testPreimagePush(t *testing.T) {
|
|||
|
||||
batcherStore := sweepbatcher.NewStoreMock()
|
||||
|
||||
sweepStore, err := sweepbatcher.NewSweepFetcherFromSwapStore(
|
||||
cfg.store, lnd.ChainParams,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
batcher := sweepbatcher.NewBatcher(
|
||||
lnd.WalletKit, lnd.ChainNotifier, lnd.Signer,
|
||||
mockMuSig2SignSweep, mockVerifySchnorrSigSuccess,
|
||||
lnd.ChainParams, batcherStore, cfg.store,
|
||||
lnd.ChainParams, batcherStore, sweepStore,
|
||||
)
|
||||
|
||||
tctx, cancel := context.WithCancel(context.Background())
|
||||
|
|
@ -953,10 +963,15 @@ func TestLoopOutMuSig2Sweep(t *testing.T) {
|
|||
|
||||
batcherStore := sweepbatcher.NewStoreMock()
|
||||
|
||||
sweepStore, err := sweepbatcher.NewSweepFetcherFromSwapStore(
|
||||
cfg.store, lnd.ChainParams,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
batcher := sweepbatcher.NewBatcher(
|
||||
lnd.WalletKit, lnd.ChainNotifier, lnd.Signer,
|
||||
mockMuSig2SignSweep, mockVerifySchnorrSigSuccess,
|
||||
lnd.ChainParams, batcherStore, cfg.store,
|
||||
lnd.ChainParams, batcherStore, sweepStore,
|
||||
)
|
||||
|
||||
tctx, cancel := context.WithCancel(context.Background())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue