def test_to_hex_uncompressed(self): string = data['pubkey_hex']['uncompressed'] assert PublicKey.from_hex(string).to_hex() == string
def test_from_hex_uncompressed(self): pubkey = PublicKey.from_hex(data['pubkey_hex']['uncompressed']) assert pubkey.pair == data['pubkey_pair'] assert pubkey.compressed is False assert pubkey.network is bitforge.networks.default
def test_from_hex_errors(self): with raises(PublicKey.InvalidHex): PublicKey.from_hex('a') with raises(PublicKey.InvalidHex): PublicKey.from_hex('a@')
def test_to_address_test_uncompress(self): pubkey = PublicKey.from_hex(data['pubkey_hex']['uncompressed'], bitforge.networks.testnet) assert pubkey.to_address().to_string() == data['address']['test_uncompressed']
def test_to_address_live_compress(self): pubkey = PublicKey.from_hex(data['pubkey_hex']['compressed'], bitforge.networks.livenet) assert pubkey.to_address().to_string( ) == data['address']['live_compressed']