コード例 #1
0
def test_invalid_bip32_key():
    #keys with invalid checksum
    bad_keys = (
        'xprv9uHRZZhk6KAJC1avXpDAp4MDc3sQKNxDiPvvkX8BrrngLNv1TxvUxt4cV1rGL5hj6KCesnDYUhd7oWgT11eZG7XnxHrnYeSvkzY7d2bhkJ7',
        'xpub68Gmy5EdvgibQVfPdqkBBCHxA5htiqg55crXYuXoQQKfDBFA1WEjWgP6LHhwBZeNK1VTsfTFUHCdrfp1bgwQ9xv5ski8PX9rL2dZXvgGDnw'
    )
    for x in bad_keys:
        with pytest.raises(Exception) as e_info:
            fake_tuple = btc.bip32_deserialize(x)
コード例 #2
0
 def derive_bip32_master_key(cls, seed):
     # FIXME: slight encoding mess
     return btc.bip32_deserialize(
         btc.bip32_master_key(seed, vbytes=cls.BIP32_priv_vbytes))
コード例 #3
0
def test_invalid_bip32_key(bad_key):
    with pytest.raises(Exception) as e_info:
        fake_tuple = btc.bip32_deserialize(bad_key)