|
2 | 2 | import unittest
|
3 | 3 | from binascii import unhexlify
|
4 | 4 |
|
5 |
| -from pybitmessage import addresses, shared |
| 5 | +from pybitmessage import addresses, highlevelcrypto |
6 | 6 |
|
7 | 7 | from .samples import (
|
8 | 8 | sample_address, sample_ripe,
|
@@ -40,9 +40,21 @@ def test_wif(self):
|
40 | 40 | """Decode WIFs of [chan] bitmessage and check the keys"""
|
41 | 41 | self.assertEqual(
|
42 | 42 | sample_wif_privsigningkey,
|
43 |
| - shared.decodeWalletImportFormat( |
| 43 | + highlevelcrypto.decodeWalletImportFormat( |
44 | 44 | b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm'))
|
45 | 45 | self.assertEqual(
|
46 | 46 | sample_wif_privencryptionkey,
|
47 |
| - shared.decodeWalletImportFormat( |
| 47 | + highlevelcrypto.decodeWalletImportFormat( |
48 | 48 | b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA'))
|
| 49 | + self.assertEqual( |
| 50 | + b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm', |
| 51 | + highlevelcrypto.encodeWalletImportFormat( |
| 52 | + sample_wif_privsigningkey)) |
| 53 | + self.assertEqual( |
| 54 | + b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA', |
| 55 | + highlevelcrypto.encodeWalletImportFormat( |
| 56 | + sample_wif_privencryptionkey)) |
| 57 | + |
| 58 | + with self.assertRaises(ValueError): |
| 59 | + highlevelcrypto.decodeWalletImportFormat( |
| 60 | + b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHq') |
0 commit comments