mirror of
https://gitlab.com/pulsechaincom/staking-deposit-cli.git
synced 2025-01-08 20:11:22 +00:00
Linting fixes
This commit is contained in:
parent
a97cc000a0
commit
96cf6911ae
5
Makefile
5
Makefile
@ -12,7 +12,4 @@ test:
|
||||
. venv/bin/activate; cd ./src; python -m pytest
|
||||
|
||||
lint:
|
||||
. venv/bin/activate; \
|
||||
cd ./src
|
||||
flake8 --ignore=E252,W504,W503 --max-line-length=120 . \
|
||||
&& mypy --follow-imports=skip --ignore-missing-imports .
|
||||
. venv/bin/activate; flake8 --ignore=E252,W504,W503 --max-line-length=120 ./src/ && mypy --follow-imports=skip --ignore-missing-imports ./src/
|
||||
|
0
src/tests/__init__.py
Normal file
0
src/tests/__init__.py
Normal file
@ -8,6 +8,7 @@ from key_derivation.mnemonic import (
|
||||
with open('tests/test_key_derivation/test_vectors/mnemonic.json', 'r') as f:
|
||||
test_vectors = load(f)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'language,language_test_vectors',
|
||||
[(a, b) for a, b in test_vectors.items()]
|
||||
|
@ -25,8 +25,8 @@ def scrypt(*, password: str, salt: str, n: int, r: int, p: int, dklen: int) -> b
|
||||
def PBKDF2(*, password: str, salt: bytes, dklen: int, c: int, prf: str) -> bytes:
|
||||
assert('sha' in prf)
|
||||
_hash = _sha256 if 'sha256' in prf else _sha512
|
||||
password = password.encode("utf-8")
|
||||
res = _PBKDF2(password=password, salt=salt, dkLen=dklen, count=c, hmac_hash_module=_hash)
|
||||
password_bytes = password.encode("utf-8")
|
||||
res = _PBKDF2(password=password_bytes, salt=salt, dkLen=dklen, count=c, hmac_hash_module=_hash) # type: ignore
|
||||
return res if isinstance(res, bytes) else res[0] # PyCryptodome can return Tuple[bytes]
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user