This repository has been archived by the owner on Dec 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 520
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
96 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.PHONY: clean | ||
clean: | ||
rm -rf *.so pyethash.egg-info/ build/ test/python/python-virtual-env/ test/c/build/ pythethash/core.so | ||
rm -rf *.so pyethash.egg-info/ build/ test/python/python-virtual-env/ test/c/build/ pyethash/*.{so,pyc} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import pyethash.core | ||
core = pyethash.core | ||
EPOCH_LENGTH = 30000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
import pyethash.core | ||
import pyethash | ||
|
||
def test_get_params(): | ||
def test_get_params_not_null(): | ||
block_num = 123456 | ||
out = pyethash.core.get_params(block_num) | ||
assert out != None | ||
|
||
if __name__ == '__main__': | ||
test_me() | ||
def test_get_params_based_on_EPOCH(): | ||
block_num = 123456 | ||
out1 = pyethash.core.get_params(block_num) | ||
out2 = pyethash.core.get_params((block_num // pyethash.EPOCH_LENGTH) * pyethash.EPOCH_LENGTH) | ||
assert out1["DAG Size"] == out2["DAG Size"] | ||
assert out1["Cache Size"] == out2["Cache Size"] | ||
|
||
def test_get_params_returns_different_values_based_on_different_block_input(): | ||
out1 = pyethash.core.get_params(123456) | ||
out2 = pyethash.core.get_params(12345) | ||
assert out1["DAG Size"] != out2["DAG Size"] | ||
assert out1["Cache Size"] != out2["Cache Size"] | ||
|
||
def test_get_cache_smoke_test(): | ||
params = pyethash.core.get_params(123456, bytes("~~~~~")) | ||
assert pyethash.core.get_cache(params) != None |
Causing install to fail?