From 5224c94aafbf54a80a9aa1aa5db676add89ab7ba Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 10 Dec 2018 14:56:54 +0100 Subject: [PATCH] autopilot/prefattach_test: assert scored nodes having addresses This addtion to the test makes sure the scored nodes have their addresses populated. This would fail without the previous commit. --- autopilot/prefattach_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/autopilot/prefattach_test.go b/autopilot/prefattach_test.go index adaee08b..c647c2d9 100644 --- a/autopilot/prefattach_test.go +++ b/autopilot/prefattach_test.go @@ -436,6 +436,11 @@ func TestConstrainedPrefAttachmentSelectTwoVertexes(t *testing.T) { "to be %v, instead was %v", expScore, candidate.Score) } + + if len(candidate.Addrs) == 0 { + t1.Fatalf("expected node to have " + + "available addresses, didn't") + } } }) if !success { @@ -633,6 +638,11 @@ func TestConstrainedPrefAttachmentSelectGreedyAllocation(t *testing.T) { "of %v, instead got %v", maxChanSize, candidate.ChanAmt) } + + if len(candidate.Addrs) == 0 { + t1.Fatalf("expected node to have " + + "available addresses, didn't") + } } // Imagine a few channels are being opened, and there's @@ -663,6 +673,11 @@ func TestConstrainedPrefAttachmentSelectGreedyAllocation(t *testing.T) { "of %v, instead got %v", remBalance, candidate.ChanAmt) } + + if len(candidate.Addrs) == 0 { + t1.Fatalf("expected node to have " + + "available addresses, didn't") + } } }) if !success { @@ -753,6 +768,11 @@ func TestConstrainedPrefAttachmentSelectSkipNodes(t *testing.T) { "of %v, instead got %v", maxChanSize, candidate.ChanAmt) } + + if len(candidate.Addrs) == 0 { + t1.Fatalf("expected node to have " + + "available addresses, didn't") + } } // We'll simulate a channel update by adding the nodes