def test_from_hex(self): address = Address.from_hex(data['hex']) assert address.network is data['network'] assert address.phash == decode_hex(data['phash']) assert address.type == data['type'] assert address.to_string() == data['base58h']
def test_from_invalid_hex(self): with raises(Address.InvalidHex): Address.from_hex('a') with raises(Address.InvalidHex): Address.from_hex('a@')