|
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 |
|
8 | 8 | sample_ripe = unhexlify('003cd097eb7f35c87b5dc8b4538c22cb55312a9f')
|
@@ -45,9 +45,21 @@ def test_wif(self):
|
45 | 45 | """Decode WIFs of [chan] bitmessage and check the keys"""
|
46 | 46 | self.assertEqual(
|
47 | 47 | sample_wif_privsigningkey,
|
48 |
| - shared.decodeWalletImportFormat( |
| 48 | + highlevelcrypto.decodeWalletImportFormat( |
49 | 49 | b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm'))
|
50 | 50 | self.assertEqual(
|
51 | 51 | sample_wif_privencryptionkey,
|
52 |
| - shared.decodeWalletImportFormat( |
| 52 | + highlevelcrypto.decodeWalletImportFormat( |
53 | 53 | b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA'))
|
| 54 | + self.assertEqual( |
| 55 | + b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm', |
| 56 | + highlevelcrypto.encodeWalletImportFormat( |
| 57 | + sample_wif_privsigningkey)) |
| 58 | + self.assertEqual( |
| 59 | + b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA', |
| 60 | + highlevelcrypto.encodeWalletImportFormat( |
| 61 | + sample_wif_privencryptionkey)) |
| 62 | + |
| 63 | + with self.assertRaises(ValueError): |
| 64 | + highlevelcrypto.decodeWalletImportFormat( |
| 65 | + b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHq') |
0 commit comments