vsergeev / ntgbtminer

A no thrills getblocktemplate Bitcoin miner, written in Python.
MIT License
84 stars 42 forks source link

test_ntgbtminer.py failing #2

Closed ngitzarak closed 4 years ago

ngitzarak commented 6 years ago

Trying to understand the bitcoin mining algorithm, ran into this issue:

bob@orangepi2:~/ntgbtminer$ python2.7 test_ntgbtminer.py
..E.....E.
======================================================================
ERROR: test_block_mine (__main__.TestBlock)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_ntgbtminer.py", line 148, in test_block_mine
    self.assertEqual(mined_block['hash'], test_vector)
TypeError: 'NoneType' object has no attribute '__getitem__'

======================================================================
ERROR: test_make_coinbase (__main__.TestTransaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_ntgbtminer.py", line 58, in test_make_coinbase
    self.assertEqual(tx_make_coinbase(coinbase_script, address, value), test_vector)
TypeError: tx_make_coinbase() takes exactly 4 arguments (3 given)

----------------------------------------------------------------------
Ran 10 tests in 70.814s

FAILED (errors=2)

Running this on an armv7l processor

ngitzarak commented 6 years ago

Seems the timeout of 60 seconds was reached for test_block_mine. Is it even supposed to run for more than a few seconds? I know that the processor I'm using is a slow one, but still?

ngitzarak commented 6 years ago

I tried running it on a x86_64 machine, same errors

JustinTArthur commented 5 years ago

I believe both errors are caused by the tests including the height header in the coinbase message instead of passing separately to the generation tx construction function. Mining code itself seems correct. Addressed in pull #4.