Fix keyword argument

Closes https://github.com/datpy/hypercore-crypto/issues/3.
This commit is contained in:
Luke Murphy 2019-11-14 19:08:54 +07:00
parent 2f73f08030
commit 60a0ff1920
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 14 additions and 2 deletions

View File

@ -131,7 +131,7 @@ def discovery_key(public_key: bytes) -> bytes:
:param public_key: The public key for hashing
"""
return crypto_generichash(HYPERCORE, key=public_key)
return crypto_generichash(HYPERCORE, k=public_key)
def _to_unsigned_64_int(num: int) -> bytes:

View File

@ -4,7 +4,15 @@ import pytest
from merkle_tree_stream import MerkleTreeNode
from pysodium import crypto_sign_PUBLICKEYBYTES, crypto_sign_SECRETKEYBYTES
from hypercore_crypto import data, key_pair, parent, random_bytes, sign, verify
from hypercore_crypto import (
data,
discovery_key,
key_pair,
parent,
random_bytes,
sign,
verify,
)
def test_key_pair_seed_length():
@ -59,3 +67,7 @@ def test_parent_digest():
_parent.hex()
== '43563406adba8b34b133fdca32d0a458c5be769615e01df30e6535ccd3c075f0'
)
def test_discovery_key_generated():
assert discovery_key(random_bytes(32)) is not None