@@ -243,6 +243,16 @@ func testCustomChannelsLarge(_ context.Context, net *NetworkHarness,
243
243
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp3 , assetID , false )
244
244
logBalance (t .t , nodes , assetID , "after invoice 3" )
245
245
246
+ // Make sure the invoice on the receiver side and the payment on the
247
+ // sender side show the individual HTLCs that arrived for it and that
248
+ // they show the correct asset amounts when decoded.
249
+ assertInvoiceHtlcAssets (
250
+ t .t , dave , invoiceResp3 , assetID , largeInvoiceAmount ,
251
+ )
252
+ assertPaymentHtlcAssets (
253
+ t .t , charlie , invoiceResp3 .RHash , assetID , largeInvoiceAmount ,
254
+ )
255
+
246
256
// We keysend the rest, so that all the balance is on Dave's side.
247
257
charlieRemainingBalance := charlieFundingAmount - largeInvoiceAmount -
248
258
fabiaInvoiceAssetAmount / 2
@@ -422,6 +432,16 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
422
432
payInvoiceWithAssets (t .t , dave , charlie , invoiceResp , assetID , true )
423
433
logBalance (t .t , nodes , assetID , "after invoice back" )
424
434
435
+ // Make sure the invoice on the receiver side and the payment on the
436
+ // sender side show the individual HTLCs that arrived for it and that
437
+ // they show the correct asset amounts when decoded.
438
+ assertInvoiceHtlcAssets (
439
+ t .t , charlie , invoiceResp , assetID , charlieInvoiceAmount ,
440
+ )
441
+ assertPaymentHtlcAssets (
442
+ t .t , dave , invoiceResp .RHash , assetID , charlieInvoiceAmount ,
443
+ )
444
+
425
445
charlieAssetBalance += charlieInvoiceAmount
426
446
daveAssetBalance -= charlieInvoiceAmount
427
447
@@ -897,6 +917,16 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
897
917
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , true )
898
918
logBalance (t .t , nodes , assetID , "after invoice" )
899
919
920
+ // Make sure the invoice on the receiver side and the payment on the
921
+ // sender side show the individual HTLCs that arrived for it and that
922
+ // they show the correct asset amounts when decoded.
923
+ assertInvoiceHtlcAssets (
924
+ t .t , dave , invoiceResp , assetID , daveInvoiceAssetAmount ,
925
+ )
926
+ assertPaymentHtlcAssets (
927
+ t .t , charlie , invoiceResp .RHash , assetID , daveInvoiceAssetAmount ,
928
+ )
929
+
900
930
charlieAssetBalance -= daveInvoiceAssetAmount
901
931
daveAssetBalance += daveInvoiceAssetAmount
902
932
@@ -1876,27 +1906,38 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
1876
1906
"invoice, multi-hop)" )
1877
1907
1878
1908
// Edge case: Big asset invoice paid by direct peer with assets.
1909
+ const bigAssetAmount = 100_000
1879
1910
invoiceResp := createAssetInvoice (
1880
- t .t , charlie , dave , 100_000 , assetID ,
1911
+ t .t , charlie , dave , bigAssetAmount , assetID ,
1881
1912
)
1882
-
1883
1913
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , false )
1884
1914
1885
1915
logBalance (t .t , nodes , assetID , "after big asset payment (asset " +
1886
1916
"invoice, direct)" )
1887
1917
1918
+ // Make sure the invoice on the receiver side and the payment on the
1919
+ // sender side show the individual HTLCs that arrived for it and that
1920
+ // they show the correct asset amounts when decoded.
1921
+ assertInvoiceHtlcAssets (
1922
+ t .t , dave , invoiceResp , assetID , bigAssetAmount ,
1923
+ )
1924
+ assertPaymentHtlcAssets (
1925
+ t .t , charlie , invoiceResp .RHash , assetID , bigAssetAmount ,
1926
+ )
1927
+
1888
1928
// Edge case: Big normal invoice, paid by direct channel peer with
1889
1929
// assets.
1930
+ const hugeAssetAmount = 1_000_000
1890
1931
_ = createAndPayNormalInvoice (
1891
- t .t , dave , charlie , charlie , 1_000_000 , assetID , true ,
1932
+ t .t , dave , charlie , charlie , hugeAssetAmount , assetID , true ,
1892
1933
)
1893
1934
1894
1935
logBalance (t .t , nodes , assetID , "after big asset payment (btc " +
1895
1936
"invoice, direct)" )
1896
1937
1897
1938
// Dave sends 200k assets and 2k sats to Yara.
1898
1939
sendAssetKeySendPayment (
1899
- t .t , dave , yara , 200_000 , assetID ,
1940
+ t .t , dave , yara , 2 * bigAssetAmount , assetID ,
1900
1941
fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1901
1942
fn .None [lnrpc.PaymentFailureReason ](),
1902
1943
)
@@ -1909,7 +1950,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
1909
1950
// channels, where the total asset value exceeds the btc capacity of the
1910
1951
// channels.
1911
1952
invoiceResp = createAssetInvoice (
1912
- t .t , dave , charlie , 100_000 , assetID ,
1953
+ t .t , dave , charlie , bigAssetAmount , assetID ,
1913
1954
)
1914
1955
1915
1956
payInvoiceWithAssets (t .t , yara , dave , invoiceResp , assetID , false )
0 commit comments