various: use NodePublic.AsNodeKey() instead of tailcfg.NodeKeyFromNodePublic()

Updates #3206

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-10-29 16:19:27 -07:00
parent ff16e58d23
commit 418adae379
10 changed files with 28 additions and 28 deletions

View File

@@ -45,7 +45,7 @@ func TestNoteReceiveActivity(t *testing.T) {
}
ra := e.recvActivityAt
nk := tailcfg.NodeKeyFromNodePublic(key.NewNode().Public())
nk := key.NewNode().Public().AsNodeKey()
// Activity on an untracked key should do nothing.
e.noteRecvActivity(nk)
@@ -217,7 +217,7 @@ func nkFromHex(hex string) tailcfg.NodeKey {
if err != nil {
panic(fmt.Sprintf("%q is not hex: %v", hex, err))
}
return tailcfg.NodeKeyFromNodePublic(k)
return k.AsNodeKey()
}
// an experiment to see if genLocalAddrFunc was worth it. As of Go