From 48a7bdc7d07469fe09c2b9a8962b2baa3a9a66be Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Mon, 13 Apr 2026 14:55:53 -0500 Subject: [PATCH] staticaddr/loopin: makeDeposit gets confheight arg Test-only change. This is needed to reuse it in another test. --- staticaddr/loopin/manager_test.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/staticaddr/loopin/manager_test.go b/staticaddr/loopin/manager_test.go index b9c19d97..8df13296 100644 --- a/staticaddr/loopin/manager_test.go +++ b/staticaddr/loopin/manager_test.go @@ -189,7 +189,8 @@ func TestSelectDeposits(t *testing.T) { func TestInitiateLoopInAllowsReservedAutoloopLabel(t *testing.T) { ctx := t.Context() - selectedDeposit := makeDeposit(1, 0, 9_000) + const confirmationHeight = 0 + selectedDeposit := makeDeposit(1, 0, 9_000, confirmationHeight) selectedOutpoint := selectedDeposit.OutPoint.String() quoteErr := errors.New("quote failed") quoteGetter := &mockQuoteGetter{ @@ -367,8 +368,14 @@ func (s *mockStore) SwapHashesForDepositIDs(_ context.Context, } // helper to create a deposit with specific outpoint and value. -func makeDeposit(h byte, index uint32, value btcutil.Amount) *deposit.Deposit { - d := &deposit.Deposit{Value: value} +func makeDeposit(h byte, index uint32, value btcutil.Amount, + confirmationHeight int64) *deposit.Deposit { + + d := &deposit.Deposit{ + Value: value, + ConfirmationHeight: confirmationHeight, + } + d.Hash = chainhash.Hash{h} d.Index = index var id deposit.ID @@ -421,11 +428,12 @@ func TestCheckChange(t *testing.T) { } // Deposits belonging to different swaps. - s1d1 := makeDeposit(1, 0, 1000) - s1d2 := makeDeposit(1, 1, 2000) - s2d1 := makeDeposit(2, 0, 1500) - s3d1 := makeDeposit(3, 0, 800) - s4d1 := makeDeposit(4, 0, 900) + const confirmationHeight = 0 + s1d1 := makeDeposit(1, 0, 1000, confirmationHeight) + s1d2 := makeDeposit(1, 1, 2000, confirmationHeight) + s2d1 := makeDeposit(2, 0, 1500, confirmationHeight) + s3d1 := makeDeposit(3, 0, 800, confirmationHeight) + s4d1 := makeDeposit(4, 0, 900, confirmationHeight) // Swaps: // A: total 3000, selected 3000 => no change.