MCPcopy Create free account
hub / github.com/copernet/copernicus / TestKeyStore_AddKeyPairs

Function TestKeyStore_AddKeyPairs

crypto/keystore_test.go:72–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestKeyStore_AddKeyPairs(t *testing.T) {
73 privateKey := getTestPrivateKey()
74 publicKey := privateKey.PubKey()
75 keyHash := publicKey.ToHash160()
76
77 keyStore := NewKeyStore()
78 keyStore.AddKey(privateKey)
79
80 keyHashList := make([][]byte, 0, 1)
81 keyHashList = append(keyHashList, keyHash)
82 keyPairs := keyStore.GetKeyPairs(keyHashList)
83
84 keyStoreNew := NewKeyStore()
85 keyStoreNew.AddKeyPairs(keyPairs)
86 assert.Equal(t, keyStore, keyStoreNew)
87}

Callers

nothing calls this directly

Calls 8

AddKeyMethod · 0.95
GetKeyPairsMethod · 0.95
AddKeyPairsMethod · 0.95
getTestPrivateKeyFunction · 0.85
NewKeyStoreFunction · 0.85
PubKeyMethod · 0.80
ToHash160Method · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected