@@ -1893,8 +1893,51 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
18931893 // Pay a bolt11 invoice with assets, which evaluates to more than the
18941894 // channel btc capacity.
18951895 _ = createAndPayNormalInvoice (
1896- t .t , charlie , dave , erin , 220_000 , assetID , true ,
1896+ t .t , charlie , dave , erin , 1_000_000 , assetID , true ,
18971897 )
18981898
1899- logBalance (t .t , nodes , assetID , "after giant asset payment" )
1899+ logBalance (t .t , nodes , assetID , "after big asset payment (btc " +
1900+ "invoice, multi-hop)" )
1901+
1902+ // Edge case: Big asset invoice paid by direct peer with assets.
1903+ invoiceResp := createAssetInvoice (
1904+ t .t , charlie , dave , 100_000 , assetID ,
1905+ )
1906+
1907+ payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , false )
1908+
1909+ logBalance (t .t , nodes , assetID , "after big asset payment (asset " +
1910+ "invoice, direct)" )
1911+
1912+ // Edge case: Big normal invoice, paid by direct channel peer with
1913+ // assets.
1914+ _ = createAndPayNormalInvoice (
1915+ t .t , dave , charlie , charlie , 1_000_000 , assetID , true ,
1916+ )
1917+
1918+ logBalance (t .t , nodes , assetID , "after big asset payment (btc " +
1919+ "invoice, direct)" )
1920+
1921+ // Dave sends 200k assets and 2k sats to Yara.
1922+ sendAssetKeySendPayment (
1923+ t .t , dave , yara , 200_000 , assetID ,
1924+ fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1925+ fn .None [lnrpc.PaymentFailureReason ](),
1926+ )
1927+ sendKeySendPayment (t .t , dave , yara , 2000 )
1928+
1929+ logBalance (t .t , nodes , assetID , "after 200k assets to Yara" )
1930+
1931+ // Edge case: Now Charlie creates a big asset invoice to be paid for by
1932+ // Yara with assets. This is a multi-hop payment going over 2 asset
1933+ // channels, where the total asset value exceeds the btc capacity of the
1934+ // channels.
1935+ invoiceResp = createAssetInvoice (
1936+ t .t , dave , charlie , 100_000 , assetID ,
1937+ )
1938+
1939+ payInvoiceWithAssets (t .t , yara , dave , invoiceResp , assetID , false )
1940+
1941+ logBalance (t .t , nodes , assetID , "after big asset payment (asset " +
1942+ "invoice, multi-hop)" )
19001943}
0 commit comments