Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 43 additions & 8 deletions itest/litd_custom_channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@ func testCustomChannels(ctx context.Context, net *NetworkHarness,
// Test case 5: Create an asset invoice on Fabia and pay it from
// Charlie.
// ------------

// First send some sats from Erin to Fabia, for Fabia to have some
// minimal sats liquidity on her end.
sendKeySendPayment(t.t, erin, fabia, 5000)

logBalance(t.t, nodes, assetID, "after erin->fabia sats keysend")

const fabiaInvoiceAssetAmount1 = 1000
invoiceResp = createAssetInvoice(
t.t, erin, fabia, fabiaInvoiceAssetAmount1, assetID,
Expand Down Expand Up @@ -987,6 +994,13 @@ func testCustomChannelsGroupedAsset(ctx context.Context, net *NetworkHarness,
// Test case 5: Create an asset invoice on Fabia and pay it from
// Charlie.
// ------------

// First send some sats from Erin to Fabia, for Fabia to have some
// minimal sats liquidity on her end.
sendKeySendPayment(t.t, erin, fabia, 5000)

logBalance(t.t, nodes, assetID, "after erin->fabia sats keysend")

const fabiaInvoiceAssetAmount1 = 1000
invoiceResp = createAssetInvoice(
t.t, erin, fabia, fabiaInvoiceAssetAmount1, nil,
Expand Down Expand Up @@ -1289,16 +1303,23 @@ func testCustomChannelsGroupTranchesForceClose(ctx context.Context,
// that transports assets from two tranches.
// ------------
const (
keySendAmount = 5000
numSends = 6
totalFirstSend = keySendAmount * numSends
keySendAmount = 5000
keySendSatAmount = 5000
numSends = 6
totalFirstSend = keySendAmount * numSends
)
for i := 0; i < numSends; i++ {
sendAssetKeySendPayment(
t.t, charlie, dave, keySendAmount, nil,
fn.None[int64](), withGroupKey(groupKey),
)
}

// With noop HTLCs implemented the sats balance of Dave will only
// increase up to the reserve amount. Let's make a direct non-asset
// keysend to make sure the sats balance is also enough.
sendKeySendPayment(t.t, charlie, dave, keySendSatAmount)

logBalanceGroup(t.t, nodes, groupIDs, "after keysend Charlie->Dave")

// ------------
Expand Down Expand Up @@ -1538,8 +1559,9 @@ func testCustomChannelsGroupTranchesHtlcForceClose(ctx context.Context,
// First, we'll send over some funds from Charlie to Dave, as we want
// Dave to be able to extend HTLCs in the other direction.
const (
numPayments = 10
keySendAmount = 2_500
numPayments = 10
keySendAmount = 2_500
keySendSatAmount = 5000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have this and the above be dynamically computed. So just numPayments * keySendSatAmount, that way future devs have one less thing to change.

)
for i := 0; i < numPayments; i++ {
sendAssetKeySendPayment(
Expand All @@ -1548,6 +1570,11 @@ func testCustomChannelsGroupTranchesHtlcForceClose(ctx context.Context,
)
}

// With noop HTLCs implemented the sats balance of Dave will only
// increase up to the reserve amount. Let's make a direct non-asset
// keysend to make sure the sats balance is also enough.
sendKeySendPayment(t.t, charlie, dave, keySendSatAmount)

// Now that both parties have some funds, we'll move onto the main test.
//
// We'll make 2 hodl invoice for each peer, so 4 total. From Charlie's
Expand Down Expand Up @@ -4219,16 +4246,24 @@ func runCustomChannelsHtlcForceClose(ctx context.Context, t *harnessTest,
// First, we'll send over some funds from Alice to Bob, as we want Bob
// to be able to extend HTLCs in the other direction.
const (
numPayments = 10
keySendAmount = 2_500
numPayments = 10
keySendAssetAmount = 2_500
keySendSatAmount = 5_000
)
for i := 0; i < numPayments; i++ {
sendAssetKeySendPayment(
t.t, alice, bob, keySendAmount, assetID,
t.t, alice, bob, keySendAssetAmount, assetID,
fn.None[int64](),
)
}

// With noop HTLCs implemented the sats balance of Bob will only
// increase up to the reserve amount. Let's make a direct non-asset
// keysend to make sure the sats balance is also enough.
sendKeySendPayment(t.t, alice, bob, keySendSatAmount)

logBalance(t.t, nodes, assetID, "after keysends to Bob")

// Now that both parties have some funds, we'll move onto the main test.
//
// We'll make 2 hodl invoice for each peer, so 4 total. From Alice's
Expand Down