electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 9e1931587d52d67108f0ec6c3a81b7474a763f7d
parent 9ca4e60b84f9fd7c470ac16f0ca7fd1683c81112
Author: ThomasV <thomasv@electrum.org>
Date:   Wed,  1 Feb 2017 10:07:01 +0100

fix tests

Diffstat:
Mlib/tests/test_bitcoin.py | 2+-
Mlib/tests/test_transaction.py | 4+++-
Mlib/transaction.py | 2+-
3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/tests/test_bitcoin.py b/lib/tests/test_bitcoin.py @@ -60,7 +60,7 @@ class Test_bitcoin(unittest.TestCase): assert xprv == "xprvA2nrNbFZABcdryreWet9Ea4LvTJcGsqrMzxHx98MMrotbir7yrKCEXw7nadnHM8Dq38EGfSh6dqA9QWTyefMLEcBYJUuekgW4BYPJcr9E7j" def _do_test_bip32(self, seed, sequence): - xprv, xpub = bip32_root(seed.decode('hex')) + xprv, xpub = bip32_root(seed.decode('hex'), 0) assert sequence[0:2] == "m/" path = 'm' sequence = sequence[2:] diff --git a/lib/tests/test_transaction.py b/lib/tests/test_transaction.py @@ -55,6 +55,7 @@ class TestTransaction(unittest.TestCase): def test_tx_unsigned(self): expected = { 'inputs': [{ + 'type': 'p2pkh', 'address': '1446oU3z268EeFgfcwJv6X2VBXHfoYxfuD', 'is_coinbase': False, 'num_sig': 1, @@ -102,6 +103,7 @@ class TestTransaction(unittest.TestCase): def test_tx_signed(self): expected = { 'inputs': [{ + 'type': 'p2pkh', 'address': '1446oU3z268EeFgfcwJv6X2VBXHfoYxfuD', 'is_coinbase': False, 'num_sig': 1, @@ -143,7 +145,7 @@ class TestTransaction(unittest.TestCase): self.assertEquals(res, ('04ee98d63800824486a1cf5b4376f2f574d86e0a3009a6448105703453f3368e8e1d8d090aaecdd626a45cc49876709a3bbb6dc96a4311b3cac03e225df5f63dfc', '19h943e4diLc68GXW7G75QNe2KWuMu7BaJ')) res = xpubkey_to_address('fd007d260305ef27224bbcf6cf5238d2b3638b5a78d5') - self.assertEquals(res, (None, '1CQj15y1N7LDHp7wTt28eoD1QhHgFgxECH')) + self.assertEquals(res, ('fd007d260305ef27224bbcf6cf5238d2b3638b5a78d5', '1CQj15y1N7LDHp7wTt28eoD1QhHgFgxECH')) class NetworkMock(object): diff --git a/lib/transaction.py b/lib/transaction.py @@ -587,7 +587,7 @@ class Transaction: elif output_type == TYPE_ADDRESS: return get_scriptPubKey(addr) else: - raise BaseException('Unknown output type') + raise TypeError('Unknown output type') return script @classmethod