diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2023-08-17 10:18:12 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2023-08-17 10:18:12 -0500 |
| commit | 894adef29588f20951a675fc25139ebb777493eb (patch) | |
| tree | 5c94911d0318160c8b11d7fc6e4783af07196285 /tests/functional_tests | |
| parent | 6c7640eb7479d21d10b783ed8166258eab6af89e (diff) | |
| parent | 842478c5a922aa67dc0cf51f71128c42587021ec (diff) | |
| download | monzero-core-894adef29588f20951a675fc25139ebb777493eb.tar.gz monzero-core-894adef29588f20951a675fc25139ebb777493eb.tar.xz monzero-core-894adef29588f20951a675fc25139ebb777493eb.zip | |
Merge pull request #8891
842478c core_rpc_server: return ID of submitted block (jeffro256)
Diffstat (limited to 'tests/functional_tests')
| -rwxr-xr-x | tests/functional_tests/mining.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/functional_tests/mining.py b/tests/functional_tests/mining.py index f1aa15c14..f1e0978fb 100755 --- a/tests/functional_tests/mining.py +++ b/tests/functional_tests/mining.py @@ -36,6 +36,7 @@ import math import monotonic import util_resources import multiprocessing +import string """Test daemon mining RPC calls @@ -52,6 +53,11 @@ Control the behavior with these environment variables: from framework.daemon import Daemon from framework.wallet import Wallet +def assert_non_null_hash(s): + assert len(s) == 64 # correct length + assert all((c in string.hexdigits for c in s)) # is parseable as hex + assert s != ('0' * 64) # isn't null hash + class MiningTest(): def run_test(self): self.reset() @@ -250,6 +256,8 @@ class MiningTest(): block_hash = hashes[i] assert len(block_hash) == 64 res = daemon.submitblock(blocks[i]) + submitted_block_id = res.block_id + assert_non_null_hash(submitted_block_id) res = daemon.get_height() assert res.height == height + i + 1 assert res.hash == block_hash @@ -346,6 +354,8 @@ class MiningTest(): t0 = time.time() for h in range(len(block_hashes)): res = daemon.submitblock(blocks[h]) + submitted_block_id = res.block_id + assert_non_null_hash(submitted_block_id) t0 = time.time() - t0 res = daemon.get_info() assert height == res.height |
