Пример #1
0
 def test_init_wif_error(self):
     with pytest.raises(TypeError):
         BaseKey(b'\x00')
Пример #2
0
 def test_public_key_compressed(self):
     base_key = BaseKey(WALLET_FORMAT_COMPRESSED_MAIN)
     assert base_key.public_key == PUBLIC_KEY_COMPRESSED
Пример #3
0
 def test_init_from_key(self):
     pk = ECPrivateKey()
     base_key = BaseKey(pk)
     assert base_key._pk == pk
Пример #4
0
    def test_init_default(self):
        base_key = BaseKey()

        assert isinstance(base_key._pk, ECPrivateKey)
        assert len(base_key.public_key) == 33
Пример #5
0
 def test_equal(self):
     assert BaseKey(WALLET_FORMAT_COMPRESSED_MAIN) == BaseKey(
         WALLET_FORMAT_COMPRESSED_MAIN)
Пример #6
0
 def test_is_compressed(self):
     assert BaseKey(WALLET_FORMAT_COMPRESSED_MAIN).is_compressed() is True
     assert BaseKey(WALLET_FORMAT_MAIN).is_compressed() is False
Пример #7
0
 def test_to_int(self):
     base_key = BaseKey(WALLET_FORMAT_MAIN)
     assert base_key.to_int() == PRIVATE_KEY_NUM