specter-desktop/tests/test_key.py
Manolis c1ce0e982a
bugfix: Util testing and small bugfix about multisig treshold (#698)
* new file

* commited changes before master pull

* copied embit tests and adapted to specter

* max blackify

* ultra max blackify

* ultra ultra max blackify

* Integration of base58 functions from embit + tests to ensure correct refactoring.

* Integration of base58 functions from embit + tests to ensure correct refactoring.

* Consistent rescan labels (#843)

* added indirect dependencies because pip-compile did not detect them (#842)

Co-authored-by: benk10 <ben.kaufman10@gmail.com>

* descriptor

* removed suspicious bitcoin-submodule-link bla

* Added tests/bitcoin to gitignore

* just renaming by adding _util_

* fix of bugs in hwi lib clone + tests

* test of mainnet address from desc now correct

Co-authored-by: Justin Moon <mail@justinmoon.com>
Co-authored-by: Kim Neunert <k9ert@gmx.de>
Co-authored-by: benk10 <ben.kaufman10@gmail.com>
2021-01-30 11:36:59 +01:00

30 lines
891 B
Python

from cryptoadvance.specter.key import Key
### Testing for the major attributes of the Key class using its classmethod
### parse_xpub which in turn uses base58 de- and encoding functions from embit
def test_fingerprint(ghost_machine_xpub_44):
key = Key.parse_xpub(ghost_machine_xpub_44)
assert key.fingerprint == "81f802e3"
def test_key_type(ghost_machine_ypub):
key = Key.parse_xpub(ghost_machine_ypub)
assert key.key_type == "sh-wpkh"
def test_purpose(ghost_machine_ypub):
key = Key.parse_xpub(ghost_machine_ypub)
assert key.purpose == "Single (Nested)"
def test_xpub(ghost_machine_ypub, ghost_machine_xpub_49):
key = Key.parse_xpub(ghost_machine_ypub)
assert key.xpub == ghost_machine_xpub_49
def test_derivation(ghost_machine_zpub):
key = Key.parse_xpub(f"[81f802e3/84'/0'/3]{ghost_machine_zpub}")
assert key.derivation == "m/84h/0h/3"