[unittest] AttributeError: CTransaction.GetHash() has been removed; use GetTxid() instead
cisba opened this issue · 2 comments
python 3.6.2
centos-release-7-4.1708.el7.centos.x86_64
======================================================================
ERROR: test (opentimestamps.tests.test_bitcoin.Test_make_timestamp_from_block)
Traceback (most recent call last):
File "/data/otsd/opentimestamps-server/opentimestamps/tests/test_bitcoin.py", line 26, in test
root_stamp = make_timestamp_from_block(digest, block, 0)
File "/data/otsd/opentimestamps-server/opentimestamps/bitcoin.py", line 77, in make_timestamp_from_block
assert commitment_tx.GetHash() == txid_stamp.msg
File "/data/otsd/lib64/python3.6/site-packages/bitcoin/core/init.py", line 363, in GetHash
raise AttributeError("CTransaction.GetHash() has been removed; use GetTxid() instead")
AttributeError: CTransaction.GetHash() has been removed; use GetTxid() instead
Ran 69 tests in 1.324s
FAILED (errors=1)
I solved downgrading the python-bitcoinlib to v0.7.0
(otsd) [btc@vmde-cis-01 otsd]$ pip install python-bitcoinlib==v0.7.0
Collecting python-bitcoinlib==v0.7.0
Downloading python_bitcoinlib-0.7.0-py2.py3-none-any.whl (81kB)
100% |████████████████████████████████| 81kB 857kB/s
Installing collected packages: python-bitcoinlib
Found existing installation: python-bitcoinlib 0.8.0
Uninstalling python-bitcoinlib-0.8.0:
Successfully uninstalled python-bitcoinlib-0.8.0
Successfully installed python-bitcoinlib-0.7.0
(otsd) [btc@vmde-cis-01 otsd]$ python3 -m unittest discover -v
(a lot of amazing messages)
Ran 69 tests in 5.265s
OK
Good catch!
I need to do some work on python-bitcoinlib itself re: segwit, and then update the opentimestamps-server to use it. Very busy this month though unfortunately. :(