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
|
|
@ -70,7 +70,7 @@ func mockMuSig2SignSweep(ctx context.Context,
|
|||
return nil, nil, nil
|
||||
}
|
||||
|
||||
func newSwapClient(config *clientConfig) *Client {
|
||||
func newSwapClient(t *testing.T, config *clientConfig) *Client {
|
||||
sweeper := &sweep.Sweeper{
|
||||
Lnd: config.LndServices,
|
||||
}
|
||||
|
|
@ -79,11 +79,16 @@ func newSwapClient(config *clientConfig) *Client {
|
|||
|
||||
batcherStore := sweepbatcher.NewStoreMock()
|
||||
|
||||
sweepStore, err := sweepbatcher.NewSweepFetcherFromSwapStore(
|
||||
config.Store, config.LndServices.ChainParams,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
batcher := sweepbatcher.NewBatcher(
|
||||
config.LndServices.WalletKit, config.LndServices.ChainNotifier,
|
||||
config.LndServices.Signer, mockMuSig2SignSweep,
|
||||
mockVerifySchnorrSigSuccess, config.LndServices.ChainParams,
|
||||
batcherStore, config.Store,
|
||||
batcherStore, sweepStore,
|
||||
)
|
||||
|
||||
executor := newExecutor(&executorConfig{
|
||||
|
|
@ -128,7 +133,7 @@ func createClientTestContext(t *testing.T,
|
|||
return expiryChan
|
||||
}
|
||||
|
||||
swapClient := newSwapClient(&clientConfig{
|
||||
swapClient := newSwapClient(t, &clientConfig{
|
||||
LndServices: &clientLnd.LndServices,
|
||||
Server: serverMock,
|
||||
Store: store,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue