wizardofozzie / pybitcointools

SImple, common-sense Bitcoin-themed Python ECC library
Other
40 stars 22 forks source link

Tests are failing #2

Closed reiven closed 8 years ago

reiven commented 8 years ago

Hi

Actual test suite (test.py) is failing

Ran 25 tests in 13.015s
FAILED (failures=5, errors=3)
wizardofozzie commented 8 years ago

I'll take a look

wizardofozzie commented 8 years ago
Testing BitcoinCore Base58 Encode/Decode vectors
ETesting BitcoinCore signatures
ETesting BitcoinCore Transactions (Valid)
EBeginning BIP0032 tests
Unable to determine language.
Returning EnglishFUnable to determine language.
Returning EnglishFUnable to determine language.
Returning EnglishFTesting BIP39 ENGLISH vectors
ETesting BIP39 JAPANESE vectors
EStarting base change tests
...Beginning RFC6979 deterministic signing tests
.Starting ECC arithmetic tests
### Round 1
### Round 2
### Round 3
### Round 4
### Round 5
### Round 6
### Round 7
### Round 8
.Starting Electrum wallet internal consistency tests
.Testing PBKDF2 HMAC SHA512....
.Testing the pure python backup for ripemd160
.Testing script vs address outputs
...Starting address and script generation consistency tests
.Attempting transaction creation
F..Transaction-style signing and verification tests
FTesting DER Signatures....
.
======================================================================
ERROR: test_all (__main__.BitcoinCore_Base58_encode_decode)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 745, in test_all
    with open("tests/base58_encode_decode.json", "r") as fo:
IOError: [Errno 2] No such file or directory: 'tests/base58_encode_decode.json'

======================================================================
ERROR: test_all (__main__.BitcoinCore_SignatureValidation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 723, in test_all
    with open("tests/signmessage.json", "r") as fo:
IOError: [Errno 2] No such file or directory: 'tests/signmessage.json'

======================================================================
ERROR: test_all (__main__.BitcoinCore_TransactionValid)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 836, in test_all
    for i, (po, tx, flags) in enumerate(load_tvv()):
  File "F:\pythoncode\pybitcointools-master\test.py", line 818, in load_tvv
    with open('tests/tx_valid.json', 'r') as fo:
IOError: [Errno 2] No such file or directory: 'tests/tx_valid.json'

======================================================================
ERROR: test_all (__main__.TestBIP39English)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 663, in test_all
    with open("tests/test_EN_BIP39.json", "r") as fo:
IOError: [Errno 2] No such file or directory: 'tests/test_EN_BIP39.json'

======================================================================
ERROR: test_all (__main__.TestBIP39Jap)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 683, in test_all
    with open("tests/test_JP_BIP39.json", "r") as fo:
IOError: [Errno 2] No such file or directory: 'tests/test_JP_BIP39.json'

======================================================================
FAIL: test_all (__main__.TestBIP0032)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 336, in test_all
    masters = map(lambda k: bip32_master_key(safe_unhexlify(k)), hexmasters)
  File "F:\pythoncode\pybitcointools-master\test.py", line 336, in <lambda>
    masters = map(lambda k: bip32_master_key(safe_unhexlify(k)), hexmasters)
  File "F:\pythoncode\pybitcointools-master\bitcoin\deterministic.py", line 151, in bip32_master_key
    if bip39_check(seed):
  File "F:\pythoncode\pybitcointools-master\bitcoin\mnemonic.py", line 141, in bip39_check
    assert len(mn_array) in range(3, 124, 3)
AssertionError

======================================================================
FAIL: test_all_testnet (__main__.TestBIP0032)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 419, in test_all_testnet
    mk = bip32_master_key(safe_unhexlify('000102030405060708090a0b0c0d0e0f'), TESTNET_PRIVATE)
  File "F:\pythoncode\pybitcointools-master\bitcoin\deterministic.py", line 151, in bip32_master_key
    if bip39_check(seed):
  File "F:\pythoncode\pybitcointools-master\bitcoin\mnemonic.py", line 141, in bip39_check
    assert len(mn_array) in range(3, 124, 3)
AssertionError

======================================================================
FAIL: test_extra (__main__.TestBIP0032)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 435, in test_extra
    master = bip32_master_key(safe_unhexlify("000102030405060708090a0b0c0d0e0f"))
  File "F:\pythoncode\pybitcointools-master\bitcoin\deterministic.py", line 151, in bip32_master_key
    if bip39_check(seed):
  File "F:\pythoncode\pybitcointools-master\bitcoin\mnemonic.py", line 141, in bip39_check
    assert len(mn_array) in range(3, 124, 3)
AssertionError

======================================================================
FAIL: test_all (__main__.TestTransaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 249, in test_all
    self.assertTrue(verify_tx_input(tx1, 0, mscript, sig1, pubs[1]), "Verification Error")
AssertionError: Verification Error

======================================================================
FAIL: test_all (__main__.TestTransactionSignVerify)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\pythoncode\pybitcointools-master\test.py", line 169, in test_all
    "Verification error"
AssertionError: Verification error
wizardofozzie commented 8 years ago

@reiven Can you check the tests again? I haven't got access to Python

reiven commented 8 years ago

Uhm now looks like there is a new piece of code pasted in test.py file

  File "test.py", line 890
    unittest.main()                    import unittest
                                            ^
SyntaxError: invalid syntax
reiven commented 8 years ago

ping @wizardofozzie

wizardofozzie commented 8 years ago

@reiven Taking a look today :) Have been without iPad or laptop but have the iPad back from repairs, using Pythonista 3 app so I can test the errors out

wizardofozzie commented 8 years ago

@reiven @vbuterin The failures stem from an issue I've raised here.

I'm 90% certain failure is due to the change to low s

Everything else is sorted out.

wizardofozzie commented 8 years ago

@vbuterin @reiven Fixed! It was an issue with v in vrs (specifically, the 27 <= v <= 34 predicate fails since v is unknown (ie None or 0) with DERs

reiven commented 8 years ago

Great, thanks @wizardofozzie