@@ -243,6 +243,16 @@ func testCustomChannelsLarge(_ context.Context, net *NetworkHarness,
243243	payInvoiceWithAssets (t .t , charlie , dave , invoiceResp3 , assetID , false )
244244	logBalance (t .t , nodes , assetID , "after invoice 3" )
245245
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+ 
246256	// We keysend the rest, so that all the balance is on Dave's side. 
247257	charlieRemainingBalance  :=  charlieFundingAmount  -  largeInvoiceAmount  - 
248258		fabiaInvoiceAssetAmount / 2 
@@ -422,6 +432,16 @@ func testCustomChannels(_ context.Context, net *NetworkHarness,
422432	payInvoiceWithAssets (t .t , dave , charlie , invoiceResp , assetID , true )
423433	logBalance (t .t , nodes , assetID , "after invoice back" )
424434
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+ 
425445	charlieAssetBalance  +=  charlieInvoiceAmount 
426446	daveAssetBalance  -=  charlieInvoiceAmount 
427447
@@ -897,6 +917,16 @@ func testCustomChannelsGroupedAsset(_ context.Context, net *NetworkHarness,
897917	payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , true )
898918	logBalance (t .t , nodes , assetID , "after invoice" )
899919
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+ 
900930	charlieAssetBalance  -=  daveInvoiceAssetAmount 
901931	daveAssetBalance  +=  daveInvoiceAssetAmount 
902932
@@ -1876,27 +1906,38 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
18761906		"invoice, multi-hop)" )
18771907
18781908	// Edge case: Big asset invoice paid by direct peer with assets. 
1909+ 	const  bigAssetAmount  =  100_000 
18791910	invoiceResp  :=  createAssetInvoice (
1880- 		t .t , charlie , dave , 100_000 , assetID ,
1911+ 		t .t , charlie , dave , bigAssetAmount , assetID ,
18811912	)
1882- 
18831913	payInvoiceWithAssets (t .t , charlie , dave , invoiceResp , assetID , false )
18841914
18851915	logBalance (t .t , nodes , assetID , "after big asset payment (asset " + 
18861916		"invoice, direct)" )
18871917
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+ 
18881928	// Edge case: Big normal invoice, paid by direct channel peer with 
18891929	// assets. 
1930+ 	const  hugeAssetAmount  =  1_000_000 
18901931	_  =  createAndPayNormalInvoice (
1891- 		t .t , dave , charlie , charlie , 1_000_000 , assetID , true ,
1932+ 		t .t , dave , charlie , charlie , hugeAssetAmount , assetID , true ,
18921933	)
18931934
18941935	logBalance (t .t , nodes , assetID , "after big asset payment (btc " + 
18951936		"invoice, direct)" )
18961937
18971938	// Dave sends 200k assets and 2k sats to Yara. 
18981939	sendAssetKeySendPayment (
1899- 		t .t , dave , yara , 200_000 , assetID ,
1940+ 		t .t , dave , yara , 2 * bigAssetAmount , assetID ,
19001941		fn .None [int64 ](), lnrpc .Payment_SUCCEEDED ,
19011942		fn .None [lnrpc.PaymentFailureReason ](),
19021943	)
@@ -1909,7 +1950,7 @@ func testCustomChannelsLiquidityEdgeCases(_ context.Context,
19091950	// channels, where the total asset value exceeds the btc capacity of the 
19101951	// channels. 
19111952	invoiceResp  =  createAssetInvoice (
1912- 		t .t , dave , charlie , 100_000 , assetID ,
1953+ 		t .t , dave , charlie , bigAssetAmount , assetID ,
19131954	)
19141955
19151956	payInvoiceWithAssets (t .t , yara , dave , invoiceResp , assetID , false )
0 commit comments