Skip to content

Commit 4d184df

Browse files
authored
Merge pull request #9259 from yyforyongyu/prepare-itest-for-blockbeat
trivial: prepare itest for `blockbeat`
2 parents 4f6b510 + 653a8ac commit 4d184df

29 files changed

+151
-112
lines changed

itest/lnd_channel_backup_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,8 @@ func createLegacyRevocationChannel(ht *lntest.HarnessTest,
14351435
}
14361436

14371437
ht.MineBlocksAndAssertNumTxes(6, 1)
1438-
ht.AssertTopologyChannelOpen(from, chanPoint)
1439-
ht.AssertTopologyChannelOpen(to, chanPoint)
1438+
ht.AssertChannelInGraph(from, chanPoint)
1439+
ht.AssertChannelInGraph(to, chanPoint)
14401440
}
14411441

14421442
// chanRestoreViaRPC is a helper test method that returns a nodeRestorer

itest/lnd_channel_policy_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ func testUpdateChannelPolicy(ht *lntest.HarnessTest) {
127127
}
128128

129129
// Make sure Alice and Carol have seen each other's channels.
130-
ht.AssertTopologyChannelOpen(alice, chanPoint2)
131-
ht.AssertTopologyChannelOpen(carol, chanPoint)
130+
ht.AssertChannelInGraph(alice, chanPoint2)
131+
ht.AssertChannelInGraph(carol, chanPoint)
132132

133133
// First we'll try to send a payment from Alice to Carol with an amount
134134
// less than the min_htlc value required by Carol. This payment should
@@ -292,7 +292,7 @@ func testUpdateChannelPolicy(ht *lntest.HarnessTest) {
292292
)
293293

294294
// Make sure Bob knows this channel.
295-
ht.AssertTopologyChannelOpen(bob, chanPoint3)
295+
ht.AssertChannelInGraph(bob, chanPoint3)
296296

297297
// Make a global update, and check that both channels' new policies get
298298
// propagated.
@@ -515,9 +515,9 @@ func testSendUpdateDisableChannel(ht *lntest.HarnessTest) {
515515
ht.RestartNodeWithExtraArgs(eve, nodeCfg)
516516

517517
// Dave should know all the channels.
518-
ht.AssertTopologyChannelOpen(dave, chanPointAliceBob)
519-
ht.AssertTopologyChannelOpen(dave, chanPointAliceCarol)
520-
ht.AssertTopologyChannelOpen(dave, chanPointEveCarol)
518+
ht.AssertChannelInGraph(dave, chanPointAliceBob)
519+
ht.AssertChannelInGraph(dave, chanPointAliceCarol)
520+
ht.AssertChannelInGraph(dave, chanPointEveCarol)
521521

522522
// We should expect to see a channel update with the default routing
523523
// policy, except that it should indicate the channel is disabled.
@@ -701,7 +701,7 @@ func testUpdateChannelPolicyForPrivateChannel(ht *lntest.HarnessTest) {
701701
)
702702

703703
// Carol should be aware of the channel between Alice and Bob.
704-
ht.AssertTopologyChannelOpen(carol, chanPointAliceBob)
704+
ht.AssertChannelInGraph(carol, chanPointAliceBob)
705705

706706
// We should have the following topology now,
707707
// Alice <--public:100k--> Bob <--private:100k--> Carol

itest/lnd_coop_close_with_htlcs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func coopCloseWithHTLCs(ht *lntest.HarnessTest) {
4747
})
4848

4949
// Wait for Bob to understand that the channel is ready to use.
50-
ht.AssertTopologyChannelOpen(bob, chanPoint)
50+
ht.AssertChannelInGraph(bob, chanPoint)
5151

5252
// Here we set things up so that Alice generates a HODL invoice so we
5353
// can test whether the shutdown is deferred until the settlement of
@@ -141,7 +141,7 @@ func coopCloseWithHTLCsWithRestart(ht *lntest.HarnessTest) {
141141
})
142142

143143
// Wait for Bob to understand that the channel is ready to use.
144-
ht.AssertTopologyChannelOpen(bob, chanPoint)
144+
ht.AssertChannelInGraph(bob, chanPoint)
145145

146146
// Set up a HODL invoice so that we can be sure that an HTLC is pending
147147
// on the channel at the time that shutdown is requested.

itest/lnd_forward_interceptor_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func testForwardInterceptorDedupHtlc(ht *lntest.HarnessTest) {
5858
cpAB, cpBC := resp[0], resp[1]
5959

6060
// Make sure Alice is aware of channel Bob=>Carol.
61-
ht.AssertTopologyChannelOpen(alice, cpBC)
61+
ht.AssertChannelInGraph(alice, cpBC)
6262

6363
// Connect the interceptor.
6464
interceptor, cancelInterceptor := bob.RPC.HtlcInterceptor()
@@ -209,7 +209,7 @@ func testForwardInterceptorBasic(ht *lntest.HarnessTest) {
209209
cpAB, cpBC := resp[0], resp[1]
210210

211211
// Make sure Alice is aware of channel Bob=>Carol.
212-
ht.AssertTopologyChannelOpen(alice, cpBC)
212+
ht.AssertChannelInGraph(alice, cpBC)
213213

214214
// Connect the interceptor.
215215
interceptor, cancelInterceptor := bob.RPC.HtlcInterceptor()
@@ -370,7 +370,7 @@ func testForwardInterceptorModifiedHtlc(ht *lntest.HarnessTest) {
370370
cpAB, cpBC := resp[0], resp[1]
371371

372372
// Make sure Alice is aware of channel Bob=>Carol.
373-
ht.AssertTopologyChannelOpen(alice, cpBC)
373+
ht.AssertChannelInGraph(alice, cpBC)
374374

375375
// Connect an interceptor to Bob's node.
376376
bobInterceptor, cancelBobInterceptor := bob.RPC.HtlcInterceptor()
@@ -478,7 +478,7 @@ func testForwardInterceptorWireRecords(ht *lntest.HarnessTest) {
478478
cpAB, cpBC, cpCD := resp[0], resp[1], resp[2]
479479

480480
// Make sure Alice is aware of channel Bob=>Carol.
481-
ht.AssertTopologyChannelOpen(alice, cpBC)
481+
ht.AssertChannelInGraph(alice, cpBC)
482482

483483
// Connect an interceptor to Bob's node.
484484
bobInterceptor, cancelBobInterceptor := bob.RPC.HtlcInterceptor()
@@ -609,8 +609,8 @@ func testForwardInterceptorRestart(ht *lntest.HarnessTest) {
609609
cpAB, cpBC, cpCD := resp[0], resp[1], resp[2]
610610

611611
// Make sure Alice is aware of channels Bob=>Carol and Carol=>Dave.
612-
ht.AssertTopologyChannelOpen(alice, cpBC)
613-
ht.AssertTopologyChannelOpen(alice, cpCD)
612+
ht.AssertChannelInGraph(alice, cpBC)
613+
ht.AssertChannelInGraph(alice, cpCD)
614614

615615
// Connect an interceptor to Bob's node.
616616
bobInterceptor, cancelBobInterceptor := bob.RPC.HtlcInterceptor()

itest/lnd_funding_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,8 @@ func testChannelFundingPersistence(ht *lntest.HarnessTest) {
927927

928928
// Make sure Alice and Carol have seen the channel in their network
929929
// topology.
930-
ht.AssertTopologyChannelOpen(alice, chanPoint)
931-
ht.AssertTopologyChannelOpen(carol, chanPoint)
930+
ht.AssertChannelInGraph(alice, chanPoint)
931+
ht.AssertChannelInGraph(carol, chanPoint)
932932

933933
// Create an additional check for our channel assertion that will
934934
// check that our label is as expected.
@@ -1055,7 +1055,7 @@ func testBatchChanFunding(ht *lntest.HarnessTest) {
10551055

10561056
// Ensure that Alice can send funds to Eve via the zero-conf channel
10571057
// before the batch transaction was mined.
1058-
ht.AssertTopologyChannelOpen(alice, chanPoint4)
1058+
ht.AssertChannelInGraph(alice, chanPoint4)
10591059
eveInvoiceParams := &lnrpc.Invoice{
10601060
Value: int64(10_000),
10611061
Private: true,
@@ -1068,9 +1068,9 @@ func testBatchChanFunding(ht *lntest.HarnessTest) {
10681068
// Mine the batch transaction and check the network topology.
10691069
block := ht.MineBlocksAndAssertNumTxes(6, 1)[0]
10701070
ht.AssertTxInBlock(block, *txHash)
1071-
ht.AssertTopologyChannelOpen(alice, chanPoint1)
1072-
ht.AssertTopologyChannelOpen(alice, chanPoint2)
1073-
ht.AssertTopologyChannelOpen(alice, chanPoint3)
1071+
ht.AssertChannelInGraph(alice, chanPoint1)
1072+
ht.AssertChannelInGraph(alice, chanPoint2)
1073+
ht.AssertChannelInGraph(alice, chanPoint3)
10741074

10751075
// Check if the change type from the batch_open_channel funding is P2TR.
10761076
rawTx := ht.GetRawTransaction(*txHash)

itest/lnd_hold_persistence_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func testHoldInvoicePersistence(ht *lntest.HarnessTest) {
5151
)
5252

5353
// Wait for Carol to see the open channel Alice-Bob.
54-
ht.AssertTopologyChannelOpen(carol, chanPointBob)
54+
ht.AssertChannelInGraph(carol, chanPointBob)
5555

5656
// Create preimages for all payments we are going to initiate.
5757
var preimages []lntypes.Preimage

itest/lnd_invoice_acceptor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func testInvoiceHtlcModifierBasic(ht *lntest.HarnessTest) {
3535
cpAB, cpBC := resp[0], resp[1]
3636

3737
// Make sure Alice is aware of channel Bob=>Carol.
38-
ht.AssertTopologyChannelOpen(alice, cpBC)
38+
ht.AssertChannelInGraph(alice, cpBC)
3939

4040
// Initiate Carol's invoice HTLC modifier.
4141
invoiceModifier, cancelModifier := carol.RPC.InvoiceHtlcModifier()

itest/lnd_misc_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ func testSphinxReplayPersistence(ht *lntest.HarnessTest) {
172172
invoiceResp := dave.RPC.AddInvoice(invoice)
173173

174174
// Wait for all channels to be recognized and advertized.
175-
ht.AssertTopologyChannelOpen(carol, chanPoint)
176-
ht.AssertTopologyChannelOpen(dave, chanPoint)
177-
ht.AssertTopologyChannelOpen(carol, chanPointFC)
178-
ht.AssertTopologyChannelOpen(fred, chanPointFC)
175+
ht.AssertChannelInGraph(carol, chanPoint)
176+
ht.AssertChannelInGraph(dave, chanPoint)
177+
ht.AssertChannelInGraph(carol, chanPointFC)
178+
ht.AssertChannelInGraph(fred, chanPointFC)
179179

180180
// With the invoice for Dave added, send a payment from Fred paying
181181
// to the above generated invoice.
@@ -417,7 +417,7 @@ func testMaxPendingChannels(ht *lntest.HarnessTest) {
417417
// Ensure that the funding transaction enters a block, and is
418418
// properly advertised by Alice.
419419
ht.AssertTxInBlock(block, fundingTxID)
420-
ht.AssertTopologyChannelOpen(alice, fundingChanPoint)
420+
ht.AssertChannelInGraph(alice, fundingChanPoint)
421421

422422
// The channel should be listed in the peer information
423423
// returned by both peers.

itest/lnd_mpp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func (m *mppTestScenario) openChannels(r *mppOpenChannelRequest) {
295295
// Make sure every node has heard every channel.
296296
for _, hn := range m.nodes {
297297
for _, cp := range m.channelPoints {
298-
m.ht.AssertTopologyChannelOpen(hn, cp)
298+
m.ht.AssertChannelInGraph(hn, cp)
299299
}
300300

301301
// Each node should have exactly 6 edges.

itest/lnd_multi-hop-error-propagation_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func testHtlcErrorPropagation(ht *lntest.HarnessTest) {
4949
)
5050

5151
// Ensure that Alice has Carol in her routing table before proceeding.
52-
ht.AssertTopologyChannelOpen(alice, chanPointBob)
52+
ht.AssertChannelInGraph(alice, chanPointBob)
5353

5454
cType := ht.GetChannelCommitType(alice, chanPointAlice)
5555
commitFee := lntest.CalcStaticFee(cType, 0)

0 commit comments

Comments
 (0)