Add a test for WIF decoding
This commit is contained in:
parent
0290607538
commit
07f815c28b
|
@ -56,3 +56,10 @@ sample_sig = unhexlify(
|
|||
sample_sig_sha1 = unhexlify(
|
||||
'304502203b50123af78b4e40f5f819ae5b8786f48826e56d0f3e65744708a493f5b65de1'
|
||||
'0221009ddce2981ea143c0ac70404a535327e774adce8eebbae2d35104f1d326255f9a')
|
||||
|
||||
|
||||
# [chan] bitmessage
|
||||
sample_wif_privsigningkey = unhexlify(
|
||||
b'a2e8b841a531c1c558ee0680c396789c7a2ea3ac4795ae3f000caf9fe367d144')
|
||||
sample_wif_privencryptionkey = unhexlify(
|
||||
b'114ec0e2dca24a826a0eed064b0405b0ac148abc3b1d52729697f4d7b873fdc6')
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
import unittest
|
||||
from binascii import unhexlify
|
||||
|
||||
from pybitmessage import addresses
|
||||
from pybitmessage import addresses, shared
|
||||
|
||||
from .samples import (
|
||||
sample_address, sample_daddr3_512, sample_daddr4_512,
|
||||
sample_deterministic_addr4, sample_deterministic_addr3,
|
||||
sample_deterministic_ripe, sample_ripe)
|
||||
sample_deterministic_ripe, sample_ripe,
|
||||
sample_wif_privsigningkey, sample_wif_privencryptionkey)
|
||||
|
||||
sample_addr3 = sample_deterministic_addr3.split('-')[1]
|
||||
sample_addr4 = sample_deterministic_addr4.split('-')[1]
|
||||
|
@ -59,3 +60,14 @@ class TestAddresses(unittest.TestCase):
|
|||
sample_addr4, addresses.encodeBase58(sample_daddr4_512))
|
||||
self.assertEqual(
|
||||
sample_addr3, addresses.encodeBase58(sample_daddr3_512))
|
||||
|
||||
def test_wif(self):
|
||||
"""Decode WIFs of [chan] bitmessage and check the keys"""
|
||||
self.assertEqual(
|
||||
sample_wif_privsigningkey,
|
||||
shared.decodeWalletImportFormat(
|
||||
b'5K42shDERM5g7Kbi3JT5vsAWpXMqRhWZpX835M2pdSoqQQpJMYm'))
|
||||
self.assertEqual(
|
||||
sample_wif_privencryptionkey,
|
||||
shared.decodeWalletImportFormat(
|
||||
b'5HwugVWm31gnxtoYcvcK7oywH2ezYTh6Y4tzRxsndAeMi6NHqpA'))
|
||||
|
|
Reference in New Issue
Block a user