Fix keyword argument
Closes https://github.com/datpy/hypercore-crypto/issues/3.
This commit is contained in:
parent
2f73f08030
commit
60a0ff1920
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user