Ejemplo n.º 1
0
 def test_init_wif_error(self):
     with pytest.raises(TypeError):
         BaseKey(b'\x00')
Ejemplo n.º 2
0
 def test_public_key_compressed(self):
     base_key = BaseKey(WALLET_FORMAT_COMPRESSED_MAIN)
     assert base_key.public_key == PUBLIC_KEY_COMPRESSED
Ejemplo n.º 3
0
 def test_init_from_key(self):
     pk = ECPrivateKey()
     base_key = BaseKey(pk)
     assert base_key._pk == pk
Ejemplo n.º 4
0
    def test_init_default(self):
        base_key = BaseKey()

        assert isinstance(base_key._pk, ECPrivateKey)
        assert len(base_key.public_key) == 33
Ejemplo n.º 5
0
 def test_equal(self):
     assert BaseKey(WALLET_FORMAT_COMPRESSED_MAIN) == BaseKey(
         WALLET_FORMAT_COMPRESSED_MAIN)
Ejemplo n.º 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
Ejemplo n.º 7
0
 def test_to_int(self):
     base_key = BaseKey(WALLET_FORMAT_MAIN)
     assert base_key.to_int() == PRIVATE_KEY_NUM