@@ -1403,6 +1403,61 @@ func testCustomChannelsForceClose(_ context.Context, net *NetworkHarness,
14031403 // UTXO he can use.
14041404 assertNumAssetUTXOs (t .t , daveTap , 1 )
14051405 assertNumAssetUTXOs (t .t , charlieTap , 2 )
1406+
1407+ // We'll make sure Dave can spend his asset UTXO by sending it all but
1408+ // one unit to Zane (the universe).
1409+ assetSendAmount := daveBalance - 1
1410+ zaneAddr , err := universeTap .NewAddr (ctxb , & taprpc.NewAddrRequest {
1411+ Amt : assetSendAmount ,
1412+ AssetId : assetID ,
1413+ ProofCourierAddr : fmt .Sprintf (
1414+ "%s://%s" , proof .UniverseRpcCourierType ,
1415+ charlieTap .node .Cfg .LitAddr (),
1416+ ),
1417+ })
1418+ require .NoError (t .t , err )
1419+
1420+ t .Logf ("Sending %v asset from Dave units to Zane..." , assetSendAmount )
1421+
1422+ // Send the assets to Zane. We expect Dave to have 3 transfers: the
1423+ // funding txn, their force close sweep, and now this new send.
1424+ itest .AssertAddrCreated (t .t , universeTap , cents , zaneAddr )
1425+ sendResp , err := daveTap .SendAsset (ctxb , & taprpc.SendAssetRequest {
1426+ TapAddrs : []string {zaneAddr .Encoded },
1427+ })
1428+ require .NoError (t .t , err )
1429+ itest .ConfirmAndAssertOutboundTransfer (
1430+ t .t , t .lndHarness .Miner .Client , daveTap , sendResp , assetID ,
1431+ []uint64 {1 , assetSendAmount }, 2 , 3 ,
1432+ )
1433+ itest .AssertNonInteractiveRecvComplete (t .t , universeTap , 1 )
1434+
1435+ // And now we also send all assets but one from Charlie to the universe
1436+ // to make sure the time lock sweep output can also be spent correctly.
1437+ assetSendAmount = charlieBalance - 1
1438+ zaneAddr2 , err := universeTap .NewAddr (ctxb , & taprpc.NewAddrRequest {
1439+ Amt : assetSendAmount ,
1440+ AssetId : assetID ,
1441+ ProofCourierAddr : fmt .Sprintf (
1442+ "%s://%s" , proof .UniverseRpcCourierType ,
1443+ charlieTap .node .Cfg .LitAddr (),
1444+ ),
1445+ })
1446+ require .NoError (t .t , err )
1447+
1448+ t .Logf ("Sending %v asset from Charlie units to Zane..." ,
1449+ assetSendAmount )
1450+
1451+ itest .AssertAddrCreated (t .t , universeTap , cents , zaneAddr2 )
1452+ sendResp2 , err := charlieTap .SendAsset (ctxb , & taprpc.SendAssetRequest {
1453+ TapAddrs : []string {zaneAddr2 .Encoded },
1454+ })
1455+ require .NoError (t .t , err )
1456+ itest .ConfirmAndAssertOutboundTransfer (
1457+ t .t , t .lndHarness .Miner .Client , charlieTap , sendResp2 , assetID ,
1458+ []uint64 {1 , assetSendAmount }, 3 , 4 ,
1459+ )
1460+ itest .AssertNonInteractiveRecvComplete (t .t , universeTap , 2 )
14061461}
14071462
14081463// testCustomChannelsBreach tests a force close scenario that breaches an old
0 commit comments