From 77b2fa027194b31093587c82314095bbf65dcb8e Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Thu, 21 Nov 2024 22:31:13 +0800 Subject: [PATCH] lntest: make sure policies are populated in `AssertChannelInGraph` --- lntest/harness_assertion.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lntest/harness_assertion.go b/lntest/harness_assertion.go index 5cadc09fd..fd4a0dfd7 100644 --- a/lntest/harness_assertion.go +++ b/lntest/harness_assertion.go @@ -1859,6 +1859,18 @@ func (h *HarnessTest) AssertChannelInGraph(hn *node.HarnessNode, op, err) } + // Make sure the policies are populated, otherwise this edge + // cannot be used for routing. + if resp.Node1Policy == nil { + return fmt.Errorf("channel %s has no policy1: %w", + op, err) + } + + if resp.Node2Policy == nil { + return fmt.Errorf("channel %s has no policy2: %w", + op, err) + } + edge = resp return nil