Skip to content

Commit

Permalink
Add BCH to AddressDB Unit Tests, Update Docco
Browse files Browse the repository at this point in the history
*Include BIP39 passphrase case in unit tests
*Include BCH addressDB sample for unit tests... (Even though it's pretty much covered in BTC...)
*Update installation docco a bit
  • Loading branch information
3rdIteration committed Nov 20, 2019
1 parent e933284 commit 6e243be
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 9 deletions.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 14 additions & 4 deletions btcrecover/test/test_seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,11 @@ def addressdb_tester(self, wallet_type, the_address_limit, correct_mnemonic, tes
assert the_address_limit > 1

#Check to see if the AddressDB exists (and if not, skip)
if not os.path.isfile("./btcrecover/test/" + test_address_db):
raise unittest.SkipTest("requires ./btcrecover/test/" + test_address_db)
if not os.path.isfile("./btcrecover/test/test-addressdbs/" + test_address_db):
raise unittest.SkipTest("requires ./btcrecover/test/test-addressdbs/" + test_address_db)

# Test Basic BIP44 AddressDB Search
addressdb = AddressSet.fromfile(open("./btcrecover/test/" + test_address_db, "rb"), preload=False)
addressdb = AddressSet.fromfile(open("./btcrecover/test/test-addressdbs/" + test_address_db, "rb"), preload=False)
wallet = wallet_type.create_from_params(hash160s=addressdb, address_limit=the_address_limit, path=test_path)

# Convert the mnemonic string into a mnemonic_ids_guess
Expand All @@ -495,7 +495,17 @@ def addressdb_tester(self, wallet_type, the_address_limit, correct_mnemonic, tes
(correct_mnemonic_ids,)), (False, 1))


#BTC AddressDB Tests
#BCH AddressDB Tests
# m/44'/145'/0'/0/1 bitcoincash:qrdupm96x04u3ssjnuj7lpy7adt9y34p5vzh95y0y7
def test_addressdb_bip44_bch(self):
self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/145'/0'/0", "addresses-BCH-Test.db")

# BCH AddressDB + BIP39 Passphrase Test
# m/44'/145'/0'/0/1 bitcoincash:qprwa49yg44mj7geswgdmlylkp9pff32c5kr8a2wq3
def test_addressdb_bip44_bch_passphrase(self):
self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/145'/0'/0", "addresses-BCH-Test.db", passphrase=u"youtube")

# BTC AddressDB Tests
#m/44'/0'/1'/0/1 1Bi3vKepTDmrRYC59WjaGDVDrg8qPsrc31
def test_addressdb_bip44_btc(self):
self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/0'/1'/0", "addresses-BTC-Test.db")
Expand Down
8 changes: 4 additions & 4 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ then try this instead:

Choose either the 32-bit version (the first one above) or the 64-bit version (the second), it **must** match the version of Python that you've installed. Note that the 64-bit version is recommended if it's supported by your computer (it is approximately 35% faster than the 32-bit version, so install the 64-bit versions of both libsodium *and* Python for best performance).

4. Copy the chosen `libsodium.dll` file into your `C:\Python27` directory.
4. Copy the chosen `libsodium.dll` file into your `C:\Windows\System32` directory.

5. Download and install one of the two update packages below from Microsoft, either the 32-bit version or the 64-bit version (the second) to match the version of Python that you've installed.

Expand Down Expand Up @@ -186,13 +186,13 @@ Install the Google's Python protobuf library, for example on Debian-like distrib

As of this writing, the 32-bit and 64-bit versions are named respectively:

pyopencl-2017.1.1+cl12-cp27-cp27m-win32.whl
pyopencl-2017.1.1+cl12-cp27-cp27m-win_amd64.whl
pyopencl‑2018.1.1+cl12cp27cp27mwin32.whl
pyopencl‑2018.1.1+cl12cp27cp27mwin_amd64.whl

2. Open a command prompt window, and type this to install PyOpenCL and its dependencies:

cd %USERPROFILE%\Downloads
C:\Python27\Scripts\pip install pyopencl-2017.1.1+cl12-cp27-cp27m-win_amd64.whl
C:\Python27\Scripts\pip install pyopencl‑2018.1.1+cl12cp27cp27mwin_amd64.whl

Note that you may need to change either the directory (on the first line) or the filename (on the second) depending on the filename you downloaded and its location.

Expand Down
2 changes: 1 addition & 1 deletion run-all-tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python

# run-all-tests.py -- runs *all* btcrecover tests
# Copyright (C) 2016, 2017 Christopher Gurnee
Expand Down

0 comments on commit 6e243be

Please sign in to comment.