swap: add constructor for swap config

This commit is contained in:
carla 2020-06-08 12:53:07 +02:00
parent 9571371153
commit 2ebbc78131
No known key found for this signature in database
GPG key ID: 4CA7FE54A6213C91
4 changed files with 22 additions and 41 deletions

View file

@ -32,11 +32,7 @@ func TestLoopInSuccess(t *testing.T) {
height := int32(600)
cfg := &swapConfig{
lnd: &ctx.lnd.LndServices,
store: ctx.store,
server: ctx.server,
}
cfg := newSwapConfig(&ctx.lnd.LndServices, ctx.store, ctx.server)
swap, err := newLoopInSwap(
context.Background(), cfg,
@ -151,11 +147,7 @@ func testLoopInTimeout(t *testing.T,
height := int32(600)
cfg := &swapConfig{
lnd: &ctx.lnd.LndServices,
store: ctx.store,
server: ctx.server,
}
cfg := newSwapConfig(&ctx.lnd.LndServices, ctx.store, ctx.server)
req := testLoopInRequest
if externalValue != 0 {
@ -282,12 +274,7 @@ func testLoopInResume(t *testing.T, state loopdb.SwapState, expired bool) {
defer test.Guard(t)()
ctx := newLoopInTestContext(t)
cfg := &swapConfig{
lnd: &ctx.lnd.LndServices,
store: ctx.store,
server: ctx.server,
}
cfg := newSwapConfig(&ctx.lnd.LndServices, ctx.store, ctx.server)
senderKey := [33]byte{4}
receiverKey := [33]byte{5}