|
1 | 1 |
|
2 |
| -import sys |
3 | 2 | import unittest
|
4 | 3 | from binascii import unhexlify
|
5 | 4 |
|
6 |
| -from pybitmessage import addresses, shared |
| 5 | +from pybitmessage import addresses, highlevelcrypto |
7 | 6 |
|
8 | 7 |
|
9 | 8 | sample_ripe = unhexlify('003cd097eb7f35c87b5dc8b4538c22cb55312a9f')
|
@@ -42,15 +41,25 @@ def test_encode(self):
|
42 | 41 | self.assertEqual(
|
43 | 42 | addresses.encodeAddress(2, 1, sample_ripe), sample_address)
|
44 | 43 |
|
45 |
| - @unittest.skipIf( |
46 |
| - sys.hexversion >= 0x3000000, 'emergency exit on python3!') |
47 | 44 | def test_wif(self):
|
48 | 45 | """Decode WIFs of [chan] bitmessage and check the keys"""
|
49 | 46 | self.assertEqual(
|
50 | 47 | sample_wif_privsigningkey,
|
51 |
| - shared.decodeWalletImportFormat( |
| 48 | + highlevelcrypto.decodeWalletImportFormat( |
52 | 49 | b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm'))
|
53 | 50 | self.assertEqual(
|
54 | 51 | sample_wif_privencryptionkey,
|
55 |
| - shared.decodeWalletImportFormat( |
| 52 | + highlevelcrypto.decodeWalletImportFormat( |
56 | 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