@@ -234,6 +234,16 @@ func testCustomChannelsLarge(_ context.Context, net *NetworkHarness,
234
234
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp3 , assetID , false )
235
235
logBalance (t .t , nodes , assetID , "after invoice 3" )
236
236
237
+ // Make sure the invoice on the receiver side and the payment on the
238
+ // sender side show the individual HTLCs that arrived for it and that
239
+ // they show the correct asset amounts when decoded.
240
+ assertInvoiceHtlcAssets (
241
+ t .t , dave , invoiceResp3 , largeInvoiceAmount ,
242
+ )
243
+ assertPaymentHtlcAssets (
244
+ t .t , charlie , invoiceResp3 .RHash , largeInvoiceAmount ,
245
+ )
246
+
237
247
// We keysend the rest, so that all the balance is on Dave's side.
238
248
charlieRemainingBalance := charlieFundingAmount - largeInvoiceAmount -
239
249
fabiaInvoiceAssetAmount / 2
@@ -420,6 +430,16 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
420
430
payInvoiceWithAssets (t .t , dave , charlie , invoiceResp , assetID , true )
421
431
logBalance (t .t , nodes , assetID , "after invoice back" )
422
432
433
+ // Make sure the invoice on the receiver side and the payment on the
434
+ // sender side show the individual HTLCs that arrived for it and that
435
+ // they show the correct asset amounts when decoded.
436
+ assertInvoiceHtlcAssets (
437
+ t .t , charlie , invoiceResp , charlieInvoiceAmount ,
438
+ )
439
+ assertPaymentHtlcAssets (
440
+ t .t , dave , invoiceResp .RHash , charlieInvoiceAmount ,
441
+ )
442
+
423
443
charlieAssetBalance += charlieInvoiceAmount
424
444
daveAssetBalance -= charlieInvoiceAmount
425
445
@@ -914,6 +934,16 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
914
934
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , true )
915
935
logBalance (t .t , nodes , assetID , "after invoice" )
916
936
937
+ // Make sure the invoice on the receiver side and the payment on the
938
+ // sender side show the individual HTLCs that arrived for it and that
939
+ // they show the correct asset amounts when decoded.
940
+ assertInvoiceHtlcAssets (
941
+ t .t , dave , invoiceResp , daveInvoiceAssetAmount ,
942
+ )
943
+ assertPaymentHtlcAssets (
944
+ t .t , charlie , invoiceResp .RHash , daveInvoiceAssetAmount ,
945
+ )
946
+
917
947
charlieAssetBalance -= daveInvoiceAssetAmount
918
948
daveAssetBalance += daveInvoiceAssetAmount
919
949
@@ -1906,27 +1936,38 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
1906
1936
"invoice, multi-hop)" )
1907
1937
1908
1938
// Edge case: Big asset invoice paid by direct peer with assets.
1939
+ const bigAssetAmount = 100_000
1909
1940
invoiceResp := createAssetInvoice (
1910
- t .t , charlie , dave , 100_000 , assetID ,
1941
+ t .t , charlie , dave , bigAssetAmount , assetID ,
1911
1942
)
1912
-
1913
1943
payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , false )
1914
1944
1915
1945
logBalance (t .t , nodes , assetID , "after big asset payment (asset " +
1916
1946
"invoice, direct)" )
1917
1947
1948
+ // Make sure the invoice on the receiver side and the payment on the
1949
+ // sender side show the individual HTLCs that arrived for it and that
1950
+ // they show the correct asset amounts when decoded.
1951
+ assertInvoiceHtlcAssets (
1952
+ t .t , dave , invoiceResp , bigAssetAmount ,
1953
+ )
1954
+ assertPaymentHtlcAssets (
1955
+ t .t , charlie , invoiceResp .RHash , bigAssetAmount ,
1956
+ )
1957
+
1918
1958
// Edge case: Big normal invoice, paid by direct channel peer with
1919
1959
// assets.
1960
+ const hugeAssetAmount = 1_000_000
1920
1961
_ = createAndPayNormalInvoice (
1921
- t .t , dave , charlie , charlie , 1_000_000 , assetID , true ,
1962
+ t .t , dave , charlie , charlie , hugeAssetAmount , assetID , true ,
1922
1963
)
1923
1964
1924
1965
logBalance (t .t , nodes , assetID , "after big asset payment (btc " +
1925
1966
"invoice, direct)" )
1926
1967
1927
1968
// Dave sends 200k assets and 2k sats to Yara.
1928
1969
sendAssetKeySendPayment (
1929
- t .t , dave , yara , 200_000 , assetID ,
1970
+ t .t , dave , yara , 2 * bigAssetAmount , assetID ,
1930
1971
fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
1931
1972
fn .None [lnrpc.PaymentFailureReason ](),
1932
1973
)
@@ -1939,7 +1980,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
1939
1980
// channels, where the total asset value exceeds the btc capacity of the
1940
1981
// channels.
1941
1982
invoiceResp = createAssetInvoice (
1942
- t .t , dave , charlie , 100_000 , assetID ,
1983
+ t .t , dave , charlie , bigAssetAmount , assetID ,
1943
1984
)
1944
1985
1945
1986
payInvoiceWithAssets (t .t , yara , dave , invoiceResp , assetID , false )
0 commit comments