@@ -10,13 +10,44 @@ import (
1010)
1111
1212func testCoopCloseWithExternalDelivery (ht * lntest.HarnessTest ) {
13- ht .Run ("set delivery address at open" , func (t * testing.T ) {
13+ ok := ht .Run ("set P2WPKH delivery address at open" , func (t * testing.T ) {
1414 tt := ht .Subtest (t )
15- testCoopCloseWithExternalDeliveryImpl (tt , true )
15+ testCoopCloseWithExternalDeliveryImpl (
16+ tt , true , lnrpc .AddressType_UNUSED_WITNESS_PUBKEY_HASH ,
17+ )
1618 })
17- ht .Run ("set delivery address at close" , func (t * testing.T ) {
19+ // Abort the test if failed.
20+ if ! ok {
21+ return
22+ }
23+
24+ ok = ht .Run ("set P2WPKH delivery address at close" , func (t * testing.T ) {
25+ tt := ht .Subtest (t )
26+ testCoopCloseWithExternalDeliveryImpl (
27+ tt , false , lnrpc .AddressType_UNUSED_WITNESS_PUBKEY_HASH ,
28+ )
29+ })
30+ // Abort the test if failed.
31+ if ! ok {
32+ return
33+ }
34+
35+ ok = ht .Run ("set P2TR delivery address at open" , func (t * testing.T ) {
36+ tt := ht .Subtest (t )
37+ testCoopCloseWithExternalDeliveryImpl (
38+ tt , true , lnrpc .AddressType_UNUSED_TAPROOT_PUBKEY ,
39+ )
40+ })
41+ // Abort the test if failed.
42+ if ! ok {
43+ return
44+ }
45+
46+ ht .Run ("set P2TR delivery address at close" , func (t * testing.T ) {
1847 tt := ht .Subtest (t )
19- testCoopCloseWithExternalDeliveryImpl (tt , false )
48+ testCoopCloseWithExternalDeliveryImpl (
49+ tt , false , lnrpc .AddressType_UNUSED_TAPROOT_PUBKEY ,
50+ )
2051 })
2152}
2253
@@ -25,7 +56,7 @@ func testCoopCloseWithExternalDelivery(ht *lntest.HarnessTest) {
2556// not. Some users set this value to be an address in a different wallet and
2657// this should not affect our ability to accurately report the settled balance.
2758func testCoopCloseWithExternalDeliveryImpl (ht * lntest.HarnessTest ,
28- upfrontShutdown bool ) {
59+ upfrontShutdown bool , deliveryAddressType lnrpc. AddressType ) {
2960
3061 alice , bob := ht .Alice , ht .Bob
3162 ht .ConnectNodes (alice , bob )
@@ -35,7 +66,7 @@ func testCoopCloseWithExternalDeliveryImpl(ht *lntest.HarnessTest,
3566 // wallet. We already correctly track settled balances when the address
3667 // is in the LND wallet.
3768 addr := bob .RPC .NewAddress (& lnrpc.NewAddressRequest {
38- Type : lnrpc . AddressType_UNUSED_WITNESS_PUBKEY_HASH ,
69+ Type : deliveryAddressType ,
3970 })
4071
4172 // Prepare for channel open.
0 commit comments