Skip to content

Commit

Permalink
itest: add coverage for disabling blinded forwards
Browse files Browse the repository at this point in the history
  • Loading branch information
carlaKC committed Mar 18, 2024
1 parent 78f9190 commit 9a65140
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions itest/list_on_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,10 @@ var allTestCases = []*lntest.TestCase{
Name: "introduction blinded error",
TestFunc: testIntroductionNodeError,
},
{
Name: "disable introduction node",
TestFunc: testDisableIntroductionNode,
},
{
Name: "removetx",
TestFunc: testRemoveTx,
Expand Down
20 changes: 20 additions & 0 deletions itest/lnd_route_blinding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,3 +941,23 @@ func testIntroductionNodeError(ht *lntest.HarnessTest) {
// Send the payment, but do not expect it to reach Carol at all.
sendAndResumeBlindedPayment(ctx, ht, testCase, route, false)
}

// testDisableIntroductionNode tests disabling of blinded forwards for the
// introduction node.
func testDisableIntroductionNode(ht *lntest.HarnessTest) {
// Disable route blinding for Bob, then re-connect to Alice.
ht.RestartNodeWithExtraArgs(ht.Bob, []string{
"--protocol.no-route-blinding",
})
ht.EnsureConnected(ht.Alice, ht.Bob)

ctx, testCase := newBlindedForwardTest(ht)
defer testCase.cleanup()
route := testCase.setup(ctx)
// We always expect failures to look like they originated at Bob
// because blinded errors are converted. However, our tests intercepts
// all of Carol's forwards and we're not providing it any interceptor
// instructions. This means that the test will hang/timeout at Carol
// if Bob _doesn't_ fail the HTLC back as expected.
sendAndResumeBlindedPayment(ctx, ht, testCase, route, false)
}

0 comments on commit 9a65140

Please sign in to comment.