routing: add test case for result interpretation of Channel Disabled failure

This commit is contained in:
Juan Pablo Civile 2021-09-06 18:40:15 -03:00
parent 78ce3abee5
commit 100abb4a30

View file

@ -349,6 +349,23 @@ var resultTestCases = []resultTestCase{
nodeFailure: nil,
},
},
// Test a channel disabled failure from the final hop in two hops. Only the
// disabled channel should be penalized for any amount.
{
name: "two hop channel disabled",
route: &routeTwoHop,
failureSrcIdx: 1,
failure: &lnwire.FailChannelDisabled{},
expectedResult: &interpretedResult{
pairResults: map[DirectedNodePair]pairResult{
getTestPair(1, 2): failPairResult(0),
getTestPair(2, 1): failPairResult(0),
},
policyFailure: getPolicyFailure(1, 2),
},
},
}
// TestResultInterpretation executes a list of test cases that test the result