MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / TestNodeKeySaveAs

Function TestNodeKeySaveAs

p2p/key_test.go:42–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

40}
41
42func TestNodeKeySaveAs(t *testing.T) {
43 filePath := filepath.Join(os.TempDir(), tmrand.Str(12)+"_peer_id.json")
44
45 assert.NoFileExists(t, filePath)
46
47 privKey := ed25519.GenPrivKey()
48 nodeKey := &NodeKey{
49 PrivKey: privKey,
50 }
51 err := nodeKey.SaveAs(filePath)
52 assert.NoError(t, err)
53 assert.FileExists(t, filePath)
54}
55
56//----------------------------------------------------------
57

Callers

nothing calls this directly

Calls 3

SaveAsMethod · 0.95
GenPrivKeyFunction · 0.92
StrMethod · 0.80

Tested by

no test coverage detected