From e629a3b45a05225517cf21936ae9b18a0844acb0 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 28 Jul 2022 19:48:10 +0800 Subject: [PATCH] itest: deprecate `createThreeHopNetwork` --- lntest/itest/lnd_multi-hop_htlc_aggregation_test.go | 2 +- lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go | 2 +- lntest/itest/lnd_multi-hop_htlc_local_timeout_test.go | 2 +- lntest/itest/lnd_multi-hop_htlc_receiver_chain_claim_test.go | 2 +- lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go | 2 +- ...d_multi-hop_local_force_close_on_chain_htlc_timeout_test.go | 2 +- ..._multi-hop_remote_force_close_on_chain_htlc_timeout_test.go | 2 +- lntest/itest/lnd_multi-hop_test.go | 3 ++- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go b/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go index ecca7efb2..a2ed1de00 100644 --- a/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go @@ -30,7 +30,7 @@ func testMultiHopHtlcAggregation(net *lntest.NetworkHarness, t *harnessTest, ctxb := context.Background() // First, we'll create a three hop network: Alice -> Bob -> Carol. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, false, c, zeroConf, ) defer shutdownAndAssert(net, t, carol) diff --git a/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go b/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go index f35c025da..d74c1b2c6 100644 --- a/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_local_chain_claim_test.go @@ -28,7 +28,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest, // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, false, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_htlc_local_timeout_test.go b/lntest/itest/lnd_multi-hop_htlc_local_timeout_test.go index 9c5063075..ecb85a2da 100644 --- a/lntest/itest/lnd_multi-hop_htlc_local_timeout_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_local_timeout_test.go @@ -28,7 +28,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest, // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, true, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_htlc_receiver_chain_claim_test.go b/lntest/itest/lnd_multi-hop_htlc_receiver_chain_claim_test.go index 348361447..5a5323ea7 100644 --- a/lntest/itest/lnd_multi-hop_htlc_receiver_chain_claim_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_receiver_chain_claim_test.go @@ -30,7 +30,7 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest, // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, false, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go b/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go index b354fdc3f..7e69502b2 100644 --- a/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_remote_chain_claim_test.go @@ -28,7 +28,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, false, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_local_force_close_on_chain_htlc_timeout_test.go b/lntest/itest/lnd_multi-hop_local_force_close_on_chain_htlc_timeout_test.go index ba57f0331..2faf8a9ac 100644 --- a/lntest/itest/lnd_multi-hop_local_force_close_on_chain_htlc_timeout_test.go +++ b/lntest/itest/lnd_multi-hop_local_force_close_on_chain_htlc_timeout_test.go @@ -27,7 +27,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness, // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, true, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_remote_force_close_on_chain_htlc_timeout_test.go b/lntest/itest/lnd_multi-hop_remote_force_close_on_chain_htlc_timeout_test.go index e1fda55ee..c35c1e85d 100644 --- a/lntest/itest/lnd_multi-hop_remote_force_close_on_chain_htlc_timeout_test.go +++ b/lntest/itest/lnd_multi-hop_remote_force_close_on_chain_htlc_timeout_test.go @@ -29,7 +29,7 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness, // First, we'll create a three hop network: Alice -> Bob -> Carol, with // Carol refusing to actually settle or directly cancel any HTLC's // self. - aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork( + aliceChanPoint, bobChanPoint, carol := createThreeHopNetworkOld( t, net, alice, bob, true, c, zeroConf, ) diff --git a/lntest/itest/lnd_multi-hop_test.go b/lntest/itest/lnd_multi-hop_test.go index 5f617d39e..4ac54b771 100644 --- a/lntest/itest/lnd_multi-hop_test.go +++ b/lntest/itest/lnd_multi-hop_test.go @@ -239,7 +239,8 @@ func checkPaymentStatus(node *lntest.HarnessNode, preimage lntypes.Preimage, return nil } -func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness, +// TODO(yy): delete +func createThreeHopNetworkOld(t *harnessTest, net *lntest.NetworkHarness, alice, bob *lntest.HarnessNode, carolHodl bool, c lnrpc.CommitmentType, zeroConf bool) ( *lnrpc.ChannelPoint, *lnrpc.ChannelPoint, *lntest.HarnessNode) {