autopilot/interface+agent: remove NodeKey from AttachmentDirective

Instead parse the pubkey bytes only when needed.
This commit is contained in:
Johan T. Halseth
2018-12-06 13:59:46 +01:00
parent 89c3c5319f
commit 5ecc209c41
5 changed files with 18 additions and 28 deletions

View File

@@ -366,11 +366,11 @@ func TestConstrainedPrefAttachmentSelectTwoVertexes(t *testing.T) {
edge2Pub := edge2.Peer.PubKey()
switch {
case bytes.Equal(directive.NodeKey.SerializeCompressed(), edge1Pub[:]):
case bytes.Equal(directive.NodeKey.SerializeCompressed(), edge2Pub[:]):
case bytes.Equal(directive.NodeID[:], edge1Pub[:]):
case bytes.Equal(directive.NodeID[:], edge2Pub[:]):
default:
t1.Fatalf("attached to unknown node: %x",
directive.NodeKey.SerializeCompressed())
directive.NodeID[:])
}
// As the number of funds available exceed the
@@ -666,8 +666,8 @@ func TestConstrainedPrefAttachmentSelectSkipNodes(t *testing.T) {
// We'll simulate a channel update by adding the nodes
// we just establish channel with the to set of nodes
// to be skipped.
skipNodes[NewNodeID(directives[0].NodeKey)] = struct{}{}
skipNodes[NewNodeID(directives[1].NodeKey)] = struct{}{}
skipNodes[directives[0].NodeID] = struct{}{}
skipNodes[directives[1].NodeID] = struct{}{}
// If we attempt to make a call to the Select function,
// without providing any new information, then we