Return bytes instead of str

Closes https://github.com/datpy/merkle-tree-stream/issues/2.
This commit is contained in:
Luke Murphy
2019-10-06 16:11:49 +02:00
parent 1c4fe9533f
commit dd1c0776b2
5 changed files with 17 additions and 18 deletions

View File

@ -6,7 +6,7 @@ import pytest
@pytest.fixture
def leaf():
def _leaf(node, roots=None):
return hashlib.sha256(node.data).hexdigest()
return hashlib.sha256(node.data).digest()
return _leaf
@ -17,6 +17,6 @@ def parent():
sha256 = hashlib.sha256()
sha256.update(first.data)
sha256.update(second.data)
return sha256.hexdigest()
return sha256.digest()
return _parent