Skip to content

Commit f3bf7b5

Browse files
committed
staticaddr/loopin: makeDeposit gets confheight arg
Test-only change. This is needed to reuse it in another test.
1 parent 23f38a1 commit f3bf7b5

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

staticaddr/loopin/manager_test.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ func TestSelectDeposits(t *testing.T) {
189189
func TestInitiateLoopInAllowsReservedAutoloopLabel(t *testing.T) {
190190
ctx := t.Context()
191191

192-
selectedDeposit := makeDeposit(1, 0, 9_000)
192+
const confirmationHeight = 0
193+
selectedDeposit := makeDeposit(1, 0, 9_000, confirmationHeight)
193194
selectedOutpoint := selectedDeposit.OutPoint.String()
194195
quoteErr := errors.New("quote failed")
195196
quoteGetter := &mockQuoteGetter{
@@ -367,8 +368,14 @@ func (s *mockStore) SwapHashesForDepositIDs(_ context.Context,
367368
}
368369

369370
// helper to create a deposit with specific outpoint and value.
370-
func makeDeposit(h byte, index uint32, value btcutil.Amount) *deposit.Deposit {
371-
d := &deposit.Deposit{Value: value}
371+
func makeDeposit(h byte, index uint32, value btcutil.Amount,
372+
confirmationHeight int64) *deposit.Deposit {
373+
374+
d := &deposit.Deposit{
375+
Value: value,
376+
ConfirmationHeight: confirmationHeight,
377+
}
378+
372379
d.Hash = chainhash.Hash{h}
373380
d.Index = index
374381
var id deposit.ID
@@ -421,11 +428,12 @@ func TestCheckChange(t *testing.T) {
421428
}
422429

423430
// Deposits belonging to different swaps.
424-
s1d1 := makeDeposit(1, 0, 1000)
425-
s1d2 := makeDeposit(1, 1, 2000)
426-
s2d1 := makeDeposit(2, 0, 1500)
427-
s3d1 := makeDeposit(3, 0, 800)
428-
s4d1 := makeDeposit(4, 0, 900)
431+
const confirmationHeight = 0
432+
s1d1 := makeDeposit(1, 0, 1000, confirmationHeight)
433+
s1d2 := makeDeposit(1, 1, 2000, confirmationHeight)
434+
s2d1 := makeDeposit(2, 0, 1500, confirmationHeight)
435+
s3d1 := makeDeposit(3, 0, 800, confirmationHeight)
436+
s4d1 := makeDeposit(4, 0, 900, confirmationHeight)
429437

430438
// Swaps:
431439
// A: total 3000, selected 3000 => no change.

0 commit comments

Comments
 (0)