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.
This commit is contained in:
Johan T. Halseth 2018-12-10 14:56:54 +01:00
parent d9eef4625e
commit 5224c94aaf
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -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